sprite

CSS Sprites - not only for background images?

Is it possible to use CSS sprites for "foreground" images - i.e. images that users are supposed to click on and interact with and maybe even print? Instead of using the CSS background-image property, instead you'd use... what? Thanks! ~S ...

XNA sprite sort mode

What is the difference and consequences of use Sprite sort mode as FrontToBack or BackToFront? It's that with FrontToBack the object that has the smaller layer value will be draw first and with BackToFron the object that has the smaller layer value will be draw last? ...

Actionscript 3 Sprite AddChild

Im new to actionscript 3 and am a little confused about how the addchild function works. I want to draw 5 houses. each house has a roof and wall. Each wall has a door and a window. I have the following classes and this is how I grouped them class Main class House class Roof //a triangle class Wall //a rectangle class...

how to obtain a CCSprite's width and height in cocos2d for iphone

That's the question xD Given an instance of a CCSprite in cocos2d in iphone, what method can I use to obtain the image width and height? Thanks! Manuel ...

Flex Sprite ButtonMode

I have a sprite on which I have added two textfields side by side, horizontally. I have set the buttonmode of sprite = true. But the mouse cursor changes from regular to clickable only when I hover it on the textfields. In the empty area between the two textfields, the cursor still appears regular/normal. Why could it be? ...

moving a sprite causes jerky movement

I've got some jerky movement of my sprite. Basically, when the user touches a point on the screen, the sprite should move to that point. This is working mostly fine... it's even taking into account a delta - because frame rate may not be consistant. However, I notice that the y movement usually finishes before the x movement (even whe...

Creating a custom animation with CGLayers?

Basically, I want to animate a shrinking circle. I've already done this by drawing progressively smaller circles onto CGLayer's, and then using if(index < 30){ [self performSelector:@selector(showNextLayer) withObject:nil afterDelay:(NSTimeInterval)0.02]; index++; } in my showNextLayer method. This works for my simple goal, but in ge...

Firefox Sprite Sheet Image Not Showing Up

I'm trying to create a chat room with emoticons. When a user types an emoticon such as :) in the chatroom, the CSS takes the proper image off the sprite sheet. But my code only seems to work in Opera and IE (odd combination). It doesn't show in Firefox or Chrome (if you manage to hone in exactly where the image should be, you can find th...

A Null Reference Exception

"Object reference not set to an instance of an object." using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace XNAdev { class Sprite { //The size of the Sprite pu...

ActionScript - clicking and determining the sprite's class

i'd like to add all or most of my mouse events to stage, but in order to do that i need to be able to tell what is the type of the sprite being clicked. i've added two sprites to the display list, one of which is from a class called Square, the other from a class called Circle. var mySquare:Sprite = new Square(); var myCircle:Sprite = ...

CSS rollover sprites.

I have used this effect before, everything is in order (As far as I see), but it's just not working. What have I missed? Fiddle here Sprite here Thanks. ...

How to create an image from array of pixel colors? (Flash, Actionscript 3)

I have a Width and Height parametr. I have been given an array of colors in such format: [r, g, b, a, r, g, b, a, r, g, b, a... etc] Data can be acsessed by something like this for(var y = 0; y < height; y++) { for(var x = 0; x < width; x++) { r = data[y*width + x + 0] g = data[y*width + x + 1] b = data[y*width...

Python Animation Timing

I'm currently working on sprite sheet tool in python that exports the organization into an xml document but I've run into some problems trying to animate a preview. I'm not quite sure how to time the frame rate with python. For example, assuming I have all of my appropriate frame data and drawing functions, how would I go about coding th...

How can you animate a sprite in SFML (C++)

Lets say I have 4 images and I want to use these 4 images to animate a character. The 4 images represent the character walking. I want the animation to repeat itself as long as I press the key to move but to stop right when I unpress it. It doesn't need to be SFML specific if you don't know it, just basic theory would really help me....

Character Movement Animation

Hi Guys! I've read a lot around everywhere, but wasn't able to make a simple character movement animation. What I have is a PNG file and an associated PLIST file with all the frames for a "walking" animation of a character that I want to run when the user touches the screen. I want to loop that animation and also at the same time, move ...

How do I test if a property exists on a object before reading its value?

I'm attempting to read a property on a series of Sprites. This property may or may not be present on these objects, and may not even be declared, worse than being null. My code is: if (child["readable"] == true){ // this Sprite is activated for reading } And so Flash shows me: Error #1069: Property selectable not found on fla...

Making a sprite always point to another sprite in XNA

I have a player sprite (playerTexture) and a crosshair sprite (crossTexture) in my game. I need to make the player sprite always face towards the crosshair. Does anyone know how to do this? I have tried doing it myself but the math involved boggles my mind. I know there's a rotation parameter in the spriteBatch.Draw() method but I'm uns...

Cocos2D TouchesEnded not allowing me to access sprites?

Hey Guys! Thanks so much for reading! - (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch * touch = [touches anyObject]; CGPoint location = [[CCDirector sharedDirector] convertToGL: [touch locationInView:touch.view]]; CGRect myRect = CGRectMake(100, 120, 75, 113); int tjx = sprite.position.x; ...

Using CGContext to display a sprite sheet iPhone

Hello, So I have a spritesheet in png format, and have already worked out the coordinates for what I want to display. I'm trying to create a method that will return a UIImage when passed the location information on the spritesheet. I'm just not sure how to use the CGContext stuff along with the the coordinates to return an UIImage. I ...

move sprite by using touchmoved in specified regions of screen

hi friends, I am making an application, in that I want to move the sprite in a specified region of the screen, With cocos2d I am not able to make move of sprite, I only know the method -(void)ccTouchMoved:(UITouch *)touches withEvent:(UIEvent *)event, but I don't know how to move a sprite, can any one help me???? Thanks in advance ...