Tag Info

New answers tagged

0

Be sure you open the Sprite sheet from the path of the asset. You can achieve this either opening the sheet within the project window or going thru your documents to the asset folder of the project location. You can open it with your editor of choice and can then update and apply the changes to the project file "your sprite sheet" doing this will update ...


0

I suppose one way to speed up the process is to format your sprite sheet in a way that its easy to edit. For example each animation to be in a couple of rows, and if there is space left, then let it white. In the end, after you have settled on a texture, go and edit the white spaces out and reattach the correct textures coordinates for all animations. I ...


0

Don't know about touch listener, but I can help you with polling based input. Here's how I'd handle input for the sprites // assuming you have the input touch co-ordinates if((touchX>= sprite.getPosition.x) && (touchX<= sprite.getPosition.x+sprite.getWidth()) && (touchY>= sprite.getPosition.y) && (touchY<= ...


1

Sounds like you have one-half of this problem licked: your player is split into independent sprites with their own animations. That seems totally reasonable for what you want to achieve. I think the next step is to investigate state machines. With state machines you could define your various states (idle, walking, attacking, falling, and so on) and then ...


0

I have a similar situation where I have numbers that animate on and off for a number puzzle game. I have a grid sprite sheet with each of these cells evenly spaced. I give each of these cells a number from 0 to X. From a cell number you can get a row and column like this: row = cellNumber / cellsWide; col = cellNumber % cellsWide; Then I have an XML ...


1

A couple days of googling, testing, coding and I have it all figured out. 1. Shadows on Sprites.. There is a work around to having sprites cast and receive shadows. This thread in the unity forum has a way to do it with sprites: http://forum.unity3d.com/threads/why-cant-sprites-gameobjects-cast-shadows.215461/ The other way is to create your own sprite ...


0

If you've made sprites at a low resolution, they become smaller when you change to a higher resolution. To counteract this, scale your sprite at runtime. Just bear in mind: if you do this, you won't see a difference between the high and low resolution, because you're simply scaling a low resolution sprite. This is only useful if you want to adapt to 16:9 ...


1

The conversion from a unit to another is a matter of a simple multiplication. You can implement a ConvertUnits static class with functions like ConvertToGameUnits(), and ConvertToBox2DUnits() to make it easier. I haven't used libgdx or Box2D, but i have used Farseer Physics engine which is basically identical with box2D but made for C#. With that being ...


0

Solved! http://docs.unity3d.com/ScriptReference/Sprite.Create.html I should've used proper Sprite factory method and passed pixel to units: Sprite.Create (texture, new Rect (x, texture.height - y, tileset.tilewidth, tileset.tileheight), new Vector2 (0.5f, 0.5f), 128)


3

There are tools out there that can help you, such as Shoebox. But tools-recommendation questions aren't appropriate here, so instead I'll describe a basic process you could use to do this yourself. Since the sprites in the sheet are regular (that is, they're all the same size) you can pretty easily write a program that produce a set of rectangle data in ...


0

Draw the bitmap using a Matrix. Matrix matrix; matrix.reset(); matrix.postScale(2.0f, 2.0f); matrix.postTranslate(getWidth()/2.0f, getHeight()/2.0f); canvas.drawBitmap(bm, matrix, null); EDIT: you probably should tell it where to draw too. My bad. EDIT2: In response to you blurry comment, you can try turning off anti-aliasing, and bitmap filtering. ...


0

buttonDown() and other methods inControllerListener only fired when the key is pressed.If you want constant movement you need a variable and set for example when KeyRight is called and unset when keyRight is released or another key like KeyLeft pressed There is a good sample here ...


0

You can achieve certain effects with shapes that would be more difficult with sprites. For example if you want a circle line or a pathway to be drawn in certain amount of time, or an image shattering to several pieces. These are that came to my mind at the moment, but obviously, you can think up anything.


4

Because 3D libraries like OpenGL and DirectX draw everything using triangles, including sprites. You put a texture (image) on triangles, put two triangles side by side to make a square and that's how you draw a "sprite" with OpenGL or Direct3D. The sprites are drawn using triangles, its not for collisions, its simply for drawing them.


1

Most like :http://www.pygame.org/docs/ref/transform.html#pygame.transform.scale If pygame use cpu rescale , you should make set of sprites offline (or make it on level load) If you can use OpenGL directly, thats trivial task (just quard with texture) - video card will make it for you.



Top 50 recent answers are included