sprite

How to change the image in a cocos2d sprite from an array?

Hello! I'm trying to change the image that a sprite from an array is displaying. Here is the code I'm using: ((Sprite *)[enemiesArray objectAtIndex:index]).image = baseImage; I get the error message: error: request for member 'image' in something not a structure or union What am I doing wrong? Thanks for reading. ...

Sprites in game programming, multiple files vs one "texture" ?

Pardon me if my lingo is not correct as I'm new to game programming. I've been looking at some open source projects and noticed that some sprites are split up into several files, all of which are grouped together to make a 2d object look like it's animating. That's straight forward. Then I'll see a different approach, with the 2d object ...

how to find pixel position of image from sprite image

i want to know how to find an image position(coordinates) while using sprite image for styling. ...

adding image on a panel

hello everyone. uhhmm. ive been finding ways on adding images(Image object) on a panel. Basically, what i want to do is to create a page - a panel with moving objects (animation using sprites). but i can't. everytime i try to add the images to the panel, the screen goes on like "blinking". anyone can help me with this? I need this ASAP.....

J2ME like Sprite on Android

For my useless project of the month I'm working on a 'emulator' to run J2ME programs on Android. But now I'm stuck with the J2ME Sprite implementation. Specifically the transformations used in it. In my Sprite I have a bitmap with three character images. I would like to paint the second frame mirrored or rotated 90 degrees. What would b...

How do I implement a sprite-sheet in OpenGLES for iPhone?

I am working from the GLSprite sample code example. What I want to know is what do I need to do to the code to have it treat my texture as a sprite-sheet? The only modification I have done so far is to create a 256 x 256 png of 16 smaller images to be my frames. I have never worked with sprite-sheets before. Thanks for your help. ...

Defining two SpriteSortModes?

In DirectX it is possible to set the D3DXSPRITE parameters to be a combination of both: D3DXSPRITE_SORT_DEPTH_BACKTOFRONT and D3DXSPRITE_SORT_TEXTURE Meaning that sprites are sorted first by their layer depth and then secondly by the texture that they are on. I'm trying to do the same in XNA and i'm having some problems. I've tried...

Access Text in Textfield on Sprite

I'm adding an array of sprites, each with an associated textfield. When the sprite is clicked (or the textfield -- either one, though I want the cursor to be a hand) all I want to do is to grab the text. (e.g. "One" in the example below). It ought to be possible to do it with dot notation, using the sprite's name, but that doesn't work...

Moving Sprites (more then one) at a time

From my Question here, http://iphonegamedev.stackexchange.com/questions/82/moving-sprites-more-then-one-at-a-time -(void)moveBox:(NSTimer*)myTimer{ float endx=[[[myTimer userInfo] valueForKey:@"endX"] floatValue]; float endy=[[[myTimer userInfo] valueForKey:@"endY"] floatValue]; float timing=[[[myTimer userInfo] valueForKey:@"ti...

Direct3d/C# - Blur area under a rectangle drawn on a sprite

Any idea how to do it? I am drawing a rectangle that is supposed to be a half-transparent window. I managed to do the transparency by drawing a half-transparent texture, but I also want to blur whatever is under the window. Normally (eg. using GDI) I would create a bitmap of the area, blur it and paint it as the background of my window...

xna: display 2d sprites behind the 3d object

Hi. i am a beginner in 3d graphics thing and learning xna and csharp. i have 3d object that i want to draw in front of a 2d background, the 3d object is simple, it is just a line. i made it from 2 dimensional VertexPositionColor[]. and then i drew it with PrimitiveType.LineStrip. and also i have a Texture2D that i displayed with Spri...

Replacing image in sprite - cocos2d game development of iphone

I want to change the sprite image. Say for example. mainSprite=[Sprite spriteWithFile:@"redFile.png"]; [self addChild:mainSprite]; Here, Sprite is already added to a layer. I have mainSprite (pointer) which can access it. If I change [mainSprite setOpacity:150]; it works perfectly. But Here I want to change the sprite image inst...

Flex: Difference between defining sprite's x, y coordinates, and painting object in some location

I have a task: I need to place about 100 sprites on one canvas (with prepared grid on it). I need to place them as invisible (circles) stones, on the board, and make visible only on mouseover. The problem I come across is following, I can't place those objects accurately into the nodes on the grid. E.g. if I define stones (it's just...

AS3/FP9 - Resize a Sprite

I've loaded a JPG with dimensions 3264x2448 into a Sprite. How can I resize it proprtionally to allow meto draw the Sprite into a BitmapData object (which in CS3/Flash Player 9 is limited to 2880 height or width). My goal is to use the Soulwire [DisplayUtils][1] to create a thumbnail. Here is the code that works fine with other, small...

cocos2d flaoting around sprite in Menu

hello , i have a menu in cocos2d game and i want to have a sprite in the backgrounf that is floating around and bouncing from the walls randomly (like a screen saver), what is the best way to do this? thank you! ...

XNA - Merge sprites for better drawing performance?

Hello! I read somewhere that when rendering a lot of 3D objects one could merge these to form a giant mesh so that only one draw call would be made. Therefore letting the, quote: "GPU do its magic", while the CPU is free for other calls than draw. So to my question, would this be feasible to do in a 2D environment with performance in m...

What's the best practice in cocos2d to redirect an animating sprite?

I am making a game where 'defending' sprites need to animate towards 'attacking' sprites. But for example an attacker might change course to attack something else, mid animation. What's the best way to manage animations, and destinations? I believe I must remove any action on a sprite before adding a new one. Perhaps I need to use the s...

AS3 Tweenlight Fade with Sprite Graphic

I have a sprite which I draw a white rectangle on (below) and want to use TweenLite to fade the sprite in and out but it either shows or hides the the sprite. animating the sizing such as scaleX works fine just the alpha. any ideas? private function Draw():void { panel.graphics.beginFill(0xFFFFFF); panel.graphics.drawRect(0,0...

How important is spriting for performance on a high traffic website?

Some high traffic sites seem to have almost crazy sprited images with almost everything in one big image. How much of a difference will this make for high traffic sites vs the difficulty in maintenance long term? I know this may be a bit of a 'how long is a piece of string' question but I am interested to understand any experience of...

Dragging a particularly large sprite up and down like scroll effect in COCOS2D

I am really stuck on this. My application is in landscape view and on one screen i wanted my instructions image to be scrollable. I have added this image as a sprite. First i tried to get scroll effect available from other sites, but soon i saw that scrolling was being done for the complete screen and not the sprite image. Then i resorte...