Tagged Questions

A 2D rendering of an object in space.

learn more… | top users | synonyms (1)

0
votes
1answer
37 views

How can I get the width and height of a picture?

I'm trying to make a script on RPG Maker XP that needs the width and height of an image to do some calculations. I tried @picture.bitmap.widthand @picture.bitmap.height but it returned the width and ...
0
votes
0answers
80 views

Dealing with 2D tiled maps in DirectX

I'm new to DirectX. I'm pretty much to the point to where I can create some sprites and attach textures to them, but I'm not fully cognizant of the entire model of textures and sprites or exactly how ...
-1
votes
1answer
632 views

Animating a sprite with mecanim

I want to try animating sprites with the Unity's mecanim. All the tutorials I found used bipedal humanoids, which already have the avatar for the animator component and imported animations. What I ...
2
votes
2answers
243 views

How can I create delays for sprite animations that work correctly when the application is killed and restored?

Please see my original question here: How should I use system time to compute delay times without stutters? In summary, I am attempting to to introduce a delay (say of 5 seconds or so) before a ...
0
votes
1answer
220 views

Why are my geometry-shader-generated billboards not showing up given the following code?

My program is a rain particle system. After processing a list of positions of rain particles, I passed them to the geometry shader for generating a billboard for each position. If I use a simple ...
4
votes
3answers
950 views

Two sided sprites

What is the most efficient way of making two sided sprites in Unity's new 2D tools? I'm looking to make playing cards with a backside and a front side.
2
votes
2answers
949 views

SDL2 sprite batching and texture atlases

I have been programming a 2D game in C++, using the SDL2 graphics API for rendering. My game concept currently features effects that could result in even tens of thousands of sprites being drawn ...
7
votes
1answer
2k views

How do I programmatically access single sprites when Sprite Mode is Multiple?

Unity 4.3 newly brings an ability to cut up a sprite sheet into multiple individual sprites. This is useful since you then only need one master spritesheet, but nevertheless get references to ...
1
vote
2answers
117 views

SDL sprite animation problem

I'm currently drawing my character from a single file, and my sprite class handles it taking the file path as an argument. Now, I need to add a simple animation, cycling between two frames. The ...
2
votes
2answers
241 views

Expandable 2d environment by spawning and controlling individual tiles

what is the best way to implement an environment that is "expandable" in every direction so that when the player moves in any direction a new row or column of tiles that can be manipulated ...
0
votes
1answer
168 views

Making a sprite jump at a particular angle android

I am making a game in android Java, and I am kind of new in game programming. Please help me out. I have a sprite that is moving horizontally across the screen. I want him to jump when the use ...
0
votes
0answers
155 views

Sprite Rendering Cost Calculation

First of all asking before asking this question I have already read following post for the clearance of my mind. Sprite Renderer Texture 2D I want to change my background texture as per device ...
0
votes
0answers
23 views

libgdx : Scrolling background from spritesheet causes lag when sprite is repositioned… am I doing something wrong? [duplicate]

So, I use a sprite from a spritesheet to draw the background and repeat it. (I am drawing it twice) However, the moment that the background is re-positioned to make it look infinite, it causes a lag. ...
2
votes
1answer
835 views

Create sprite renderer using custom material

I have done following thing. Create Material Attach sprite with texture type as Texture Add sprite renderer component to game object Assign material to it that I create in last steps There is no ...
2
votes
3answers
1k views

Polygons vs sprites rendering performance in Unity for windows phone 8

I'm currently building a windows phone 8 game with unity, having 111 (no more no less) sprites being updated each frames. I have a strong overhead in the profiler (70% to 90% minimum) I tried the ...
3
votes
1answer
768 views

How do I make a 2D character aim their gun toward the mouse?

Heli Attack is a perfect example of the shooting mechanic I'd like. The character aims perpetually toward the mouse. What's going on here? From what I've read so far, you could separate the arm and ...
0
votes
1answer
267 views

How do I make a sprite blink on an HTML5 canvas?

I'm thinking of the flashing effect many games have when a character gets hit and takes damage. Something like overlaying a lighter color on visible sprite pixels for a second.
0
votes
2answers
396 views

Recommended way to handle sprite assets for different screen densities (Android)

I am currently working on a 2D game for Android. All of the images that I render were created as SVG's and then exported to PNG's which I have placed in my assets directory. These images are also all ...
1
vote
2answers
167 views

What is the correct way to draw layered Sprites in modern OpenGL?

So what do I mean by layered sprites? Layered Sprites are Sprites that consist of multiple layers, e.g. you have sprite sheets for the basic Body, the Head, Clothes, Weapons, etc. Well now I wanted ...
1
vote
1answer
198 views

How to adjust a font to fit inside a speech bubble?

I'm creating a game that contains a speech bubble for dialog. The idea of this function is to allow one call to set new text in a speech bubble. The speech bubble will adjust in size of the new font ...
2
votes
3answers
237 views

Is it more efficient to encode rotation in a spritesheet or rotate at runtime?

I'm developing a game with JavaScript and HTML5 and I'm wondering about the performance implications of sprite rotations. There are two ways that I know to rotate a sprite: Rotate the actual sprite ...
3
votes
1answer
104 views

Pygame collision detection less frequent when objects are increased

I currently experiencing an issue in pygame where whenever i increase the number of objects e.g. platforms, rocks for a in range(150): rock = Rock(0,0) OR incresing the range which they spawn ...
0
votes
2answers
482 views

AndEngine - Smooth scaling on a sprite

I'm trying to implement a pinch zoom on a sprite. I would like to get an effect like the SmoothCamera, but on a single sprite. I've managed to pinch zoom on the sprite by changing its scale, but the ...
0
votes
1answer
108 views

methods for player interaction with world

What's the proper way, a proper way, or any proper way at all, to handle interactions between a sprite (usually a player) and another sprite (can be any other object)? (in a tile based world) i.e. ...
2
votes
1answer
7k views

How can I programatically generate sprite instances in Unity?

I want to create a block-based puzzle game that generates blocks as they are required, however I cannot seem to find any good imformation on how to do something like this using Unity's new sprite ...
0
votes
1answer
128 views

How can I support a background more complex than a flat color?

I'm a beginner at making 2D games. Up until now, I always created my games with a black background, or a fixed color. This is because my sprites always have a black (or a solid color) background, and ...
1
vote
1answer
138 views

How to prevent a sprite to move in an angle that will lead to collision

I have two sprites that can move in any angle. The sprites are rectangular. I created bounding boxes for both the sprites. These boxes rotate whenever the sprite rotates. They always surround the ...
2
votes
1answer
136 views

How do I rotate a bounding box together with a sprite?

I have a game object with a sprite that can rotate. It's a rectangle. I need its bounding box to rotate with it. How do I make sure that they can both rotate, but they're always both at the same ...
1
vote
2answers
161 views

Detecting collision of two sprites that can rotate [duplicate]

I have a problem with collision detection in a 2D Java game. Normally, what I would do is create a getBounds() method for an object that can collide with other objects. This method would return a new ...
1
vote
1answer
142 views

pygame - avoiding sprite 'jitters' on rotating the image

Is there a common trick for getting around sprites that are changing directions 'too quickly' and causing their sprite to display erratically? In this project, the player moves in 8 directions by ...
3
votes
1answer
281 views

Collision detection for sloping tiles

I've been looking into adding 'sloping' tiles into my platform game and my first attempt at collision detection with these tiles has produced some promising results (considering it's a first attempt), ...
1
vote
1answer
128 views

Telling my shader when to use which Texture

So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles. Now im ...
1
vote
1answer
117 views

UI in Canvas-Games [closed]

I am quite new to programming with <canvas/> and WebGL, but very familiar in HTML5. So far, I have made to render some entities on the <canvas/>. Next would be to add a simple HUD to it. ...
0
votes
1answer
132 views

Load all bitmaps at once or only when needed?

I am starting to get a pretty hefty amount of bitmaps in my 2d game for android. I load them all in 3 colors to save some memory but the thing is, I load all of them when "Start game" is pressed, even ...
0
votes
1answer
249 views

How should I determine the bounding rectangles for frames within a sprite sheet? [closed]

I have a spritesheet for a character. The spritesheet has several rows, and each row represents an animation. The elements within a row might vary in width. How can I load the different sections of ...
5
votes
1answer
768 views

How should I handle sprite creation for customizable 2D characters?

I'm want to create avatar animations (sprites) for a browser-based MMORPG. The player is able to customize the character, and the content changes often (new weapons, armors, and so on). How can I ...
2
votes
1answer
596 views

How to split a 2D sprite tile set into individual sprites?

I see a lot of sprite catalogs for games provided as single PNG image, like the one below. I'm interested if I have to manually create tiles from that, or if there's some program that can split it ...
0
votes
1answer
162 views

What size textures do I need for a 2D grid based game if my tiles are larger than textures I have?

I'm building a grid-based game for iPad, and for usability purposes I've selected my game grid to be built of 75x75 squares. However, so far I've seen that the majority of (free)texture catalogs I can ...
1
vote
4answers
527 views

How to set speed of circular motion

Edit 2 - clarification Just to clarify, the issue I have at the moment is how I specify a time (in seconds) for a complete revolution to occur. My delta is fixed and is 1/ticks per second (1/60). ...
2
votes
2answers
160 views

Replicating no. of sprites without letting the app to slow down and crash

Is it possible that if I'm making a a simple drag-n-drop game, does making a new sprite via constructor with texture as a parameter makes the game slower and depletes more memory until it crashes or ...
4
votes
4answers
6k views

Unity: Flip Sprite Direction

I'm toying around with the new Sprite class in Unity, and I'm trying to work out how to change the direction the sprite is facing ("flip" it). I'm sure I can most likely just scale it across the x ...
1
vote
3answers
195 views

Inconsistent sprite velocity?

I'm moving my sprites using the following formula: Code that I'm using (Only shows sprite's X position being calculated but Y position is also being done) spriteGridX = 240/480; //I start out with ...
2
votes
1answer
252 views

Is it possible to achieve a smooth sprite animation with a fixed 60 FPS using Java 2D?

I've seen a lot of different game loops, and before implementing anything complicated I decided to start with a capped 60 FPS. My run method looks like this in my game thread: /** * Fixed Frames Per ...
1
vote
1answer
241 views

How can I improve the performance of texture switching without resorting to atlasing?

I'd like to use texture images that are not a sprite sheet or other form of texture atlas, mainly because I'll be consistently adding and swapping textures while I figure out the direction my game ...
1
vote
2answers
198 views

How to draw a rotated pixel perfect line by hand?

If you have a pixel perfect line like 1:16 pixels, and you want to draw that same line rotated by a degree, for example 45°, what would be the correct way to do that by hand? I know it should have ...
11
votes
1answer
8k views

Can Unity 2D be used to make pixel-art games?

I'm looking at the new 2D features introduced in Unity 4.3, and I think I might be missing something. To me it looks like they are designed for high-res 2D games, where scaling the sprites is ok, but ...
0
votes
0answers
34 views

2D collision beetween a sprite and an array of sprites [duplicate]

I am creating a simple Android jumper (think Doodle Jump or Abduction) using libGDX so I can get started in game programming. My problem is that I need to figure out a way to check for collision ...
1
vote
1answer
395 views

Limiting the speed of a dragged sprite in Cocos2dx

I am trying to drag a row of sprites using ccTouchesMoved. By that I mean that there is a row of sprites (they are colored squares) lined up next to each other and if I grab one with a touch the rest ...
1
vote
1answer
1k views

OpenGL ES 2.0. Sprite Sheet Animation

I've found a bunch of tutorials on how to make this work on Open GL 1 & 1.1 but I can't find it for 2.0. I would work it out by loading the texture and use a matrix on the vertex shader to move ...
1
vote
1answer
312 views

2D fighting bounding boxes

I'm prototyping a 2D platformer/brawler game for uni and I'm having some trouble with creating collision/bounding boxes. This is most likely going to end up on a Vita so I do have some library ...