Move background relative to an object [closed] - background

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
This is a Processing 2.x related question but you can give a general answer and I will translate that into processing sketch.
I want to move my background relative to an object that i have made in box2d and is following a trajectile path. I want that object to remain inside the sketch and not to go past the width of the sketch. how can I do that?
This is what I have tried: (The image displayed is a large image, 4 times the width of the sketch)
void Display(Gulli gulli) {
imageMode(CENTER);
if (gulli.isMoving()) {
Vec2 gulli_pos = gulli.getPosition();
gulli_pos.mulLocal(-1); // to move background in opposite direction of the object
pushMatrix();
translate(gulli_pos.x+width*1.63, +height/2+gulli_pos.y);
image(img, pos.x, pos.y);
popMatrix();
} else {
pushMatrix();
translate(width*1.5, -height/2);
image(img, pos.x, pos.y);
popMatrix();
}
}

I did something like that ones, let me try to explain it whit this simple drawing.
The black square is the background image, the grey one the sketch screen of Processing and the red ball your moving object.
The idea it's that while the distance between the side of the backImage and the side of the screen is greater than 0, you move the background image using the same speed than the ball, but in the opposite direction. Ones this condition changes you move the ball normally.
Hope this help's.
Regards
Jose

Related

How to remove a grey shadow from a JPEG? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
So in Photoshop we all know it's relatively easy to remove a white background from a .jpg image if the contrast is quite visible.
The problem with this image though is it has a grey shadow at the bottom of the image that is reliant on the white background, and therefore once it becomes transparent the shadow looks nasty.
What would be the best approach to remove this once the white background had been removed?
Thanks
https://s15.postimg.org/k2itasu7v/i_Stock_104502239_LARGE.jpg
You can use the Polygonal Lasso Tool. Manual removing.
Zoom to the shadow, select it with the Polygonal Lasso Tool > Right click and : Refine the edge + give it a bit of Feather and paint using the background color of the image.

How can I create a gif with more than 256 colors like this one? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Bonjour ! this is my first question !
I'm trying some UI animation in Photoshop, and I want to export in GIF file. But, GIF can't support more than 256 colors right ? So my quality is really low...
I think I found a gif with 32697 colors on this website, so is it possible ?...
http://phil.ipal.org/tc.html
If someone can explain me how it's work... I'm pretty lost.
Thanks for your answer.
True-color GIFs are a hack that uses the animated GIF format, puts a 256 color square in each frame, offset from all previous frames, makes each frame not disappear when the next frame appears, and loops only once. Few programs other than web browsers display such images correctly. The files are very large as a result and not suitable for web use.
Try PNG instead.

Explosion animation on Hit Sprite Kit [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I wonder how to make add one explosion animation to my game when my character/Ship is hit by an enemy? I've managed to add explosion sound but I want to add a image aswell to the hit on my character, wondering how?
if ([_ship intersectsNode:asteroid]) {
asteroid.hidden = YES;
SKAction *blink = [SKAction sequence:#[[SKAction fadeOutWithDuration:0.1],
[SKAction fadeInWithDuration:0.1]]];
SKAction *blinkForTime = [SKAction repeatAction:blink count:4];
SKAction *shipExplosionSound =
[SKAction playSoundFileNamed:#"explosion_large.caf" waitForCompletion:NO];
[_ship runAction:[SKAction sequence:#[shipExplosionSound,blinkForTime]]];
_lives--;
NSLog(#"your ship has been hit!");
}
To achieve an explosion effect you should use a Particle Emitter Editor bundled with Xcode and a SKEmitterNode.
A particle emitter special effect begins with an image file that is to represent the particle. The emitter is then responsible for generating multiple instances of the particle on the scene and animating each particle subject to a set of properties. These properties control aspects of the special effect such as the rate of particle generation, the angle and speed of motion of particles, whether or not particles rotate and the way in which the particles blend in with the background.
With some time and experimentation, a wide range of special effects ranging from smoke to explosions can be created using particle emitters.
Source:
http://www.techotopia.com/index.php/An_iOS_7_Sprite_Kit_Particle_Emitter_Tutorial
I managed to achieve a really good looking explosion effects in my apps using SKEmitterNode and playing with the values in the editor.
Hope it helps.

iOS: "Flip-Clock" animation - how to? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
currently I´m working on an App where I like to implement a nice "flip-clock"-animation for numbers (like this: http://www.youtube.com/watch?v=dKhsn-qrEZY).
It is realy hard to find a resource for an animation like this one I´m looking for. One of the best I found was this one: http://www.voyce.com/index.php/2010/04/10/creating-an-ipad-flip-clock-with-core-animation/
But I´m not very trusted with CoreAnimation. So it is hard to dive into the article I found.
The article didnt describe all pieces in detail. As consequence (for me ;))the problem is that I have no idea where I have to start...
Did anyone know a good article / resource / place where I can find a better explained solution for such an animation?
Or can someone help me to understand this article better?
Thank you!
You can apply a 3D transform on a UIView layer to rotate about any of the axis (or combination)...
CATransform3DMakeRotation(<#CGFloat angle#>, <#CGFloat x#>, <#CGFloat y#>, <#CGFloat z#>)
This will rotate the view it is applied to by the angle (given in radians).. specify either 0 or 1 for the x, y and z values to decided whether or not to apply the angle rotation to that axis.
Now of course you can animate this transform by creating a normal UIVIew beginAnimations block, setting the transform and commiting the animation block.
To set the transform, use [myView.layer setTransform:myTransform];

Photoshop: Replace Color With Transparency [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I want to replace the black color in this image with transparency. This would also mean that the gradient in the center of the image would not fade to black but fade to transparency. How is this possible?
The general approach with a solid-color b/g:
Click on the background with Magic Wand: the area becomes surrounded by wavy dashes
Hit the Delete key: background has a hatched pattern
Save and Done
For this to work your image must be RGB. If it isn't already make an RGB copy. If there are different shades of black in the background, you have to do this for each group of pixels that have a different RGB definition. In other words, it's easy with a solid-color background and increasingly time intensive depending on the number of RGB combos in the graphic's background.