sprite

Rotating a cocos2d sprite on an anchor point outside of the sprite

Currently the setanchor function only sets the anchor within the sprite frame. Is there any (easier) wway to change the anchor point to a coordinate on screen space? My purpose is to allow the sprite to rotate around a circle. TIA for any suggestions made. ...

Animating UIImageView iPhone

Hi, i'm having trouble about animating an Image in a UIImageView. I've created an image view in interface builder and linked it to its iboutlet. Here is my code. @interface Game : UIViewController <UIAccelerometerDelegate>{ IBOutlet UIImageView *diying; } @property (nonatomic, retain) UIImageView *diying; In the vie...

Adding an ActionScript eventListener that takes the whole sprite

Hello, I have a very simple constructor in ActionScript as the following: public function ButtonTest() { this.addEventListener(MouseEvent.CLICK, browseFiles); } My problem is that when I open the SWF file itself, the window is not full size and the whole area responds to the mouse click. If I expand the window to full size, a margin ...

Sprite background image lags on mouse hover

I have basic DOM menu that has sprite background images for the first level of "LI"s. It works just fine, but I guess there is some problem and instead of switching the image right away on hover it goes blank and after about a second the hover image "appears" (shifts). That happens only on first hovering. After that it's smooth like it'...

60K+ Sprites on the 360?

Hey everyone, Just wondering - throwing ideas in my head - about starting a new XNA project for the 360. I would like it to be retro-old school, and emulating scanlines and color palettes and such. As part of this idea, what I would ideally like to do is manually draw each and every pixel of the screen. So, worst-case scenario I would...

Automed CSSSprites -- csssprites.org

If this is a question that shouldn't be on SO, please let me know. Has anyone tried the website: http://csssprites.org/ To autogenerate and use CSS Sprites? What are your thoughts? I'm thinking about implementing (constantly looking for new ways to improve performance) ...

Interface Builder + Sprite Strips

Hello, I'm in the midst of porting a win32 app to cocoa. Wherever possible, I'm using IB, since... well its way easier in every way possible, obviously. One thing is the designer and the win32 dev set up all the button assets on a massive "sprite sheet" such you move around the viewport to determine button state. Similar to how yahoo do...

Animation in Cocos2d Please Help!

Hello, I am trying to make a sprite animate in cocos2D. I believe I have the animation set up, but how do I draw the animating sprite onto the screen? Here is what I have: id anim = [[[CCAnimation alloc] initWithName:@"char_walking" delay:1/12.0] autorelease]; [anim addFrame:@"run2.png"]; [anim addFrame:@"run1.png"]; [ani...

NES Programming - Nametables?

Hello everyone, I'm wondering about how the NES displays its graphical muscle. I've researched stuff online and read through it, but I'm wondering about one last thing: Nametables. Basically, from what I've read, each 8x8 block in a NES nametable points to a location in the pattern table, which holds graphic memory. In addition, the ...

how to make a sprite goes behind another sprite

I'm using CCSprite to redraw my app's background image (it's like a moving background). However I'm also using CCSprite to draw my hero and enemies. At some cases the enemies goes behind my background image. My understanding is that if you do: [self addChild:sprite1]; [self addChild:sprite2]; Then sprite1 will be behind sprite2 if the...

Flash/ActionScript - Making Sprites With the IDE

i've been studying and using actionscript exclusively for too long, that i don't even know how to import a regular image into Flash and create a ready-made sprite that i can use in my APIs. what are the steps to create a sprite from an image asset in the library? ...

ActionScript Read Sprite's Graphics?

how can i retrieve the set graphics properties of a sprite? for example, in the code below, i'd like to get the color of the sprite, also it's rounded corners setting and other graphics attributes. var sp:Sprite = new Sprite(); sp.graphics.beginFill(0xFF0000, 0.75); sp.graphics.drawRoundRect(0, 0, 300, 50, 10, 10); sp.graphics.endFill(...

Cocos2d Sprite performance with bitplanes

Is it possible to improve performance drawing sprites by reducing the number of bit planes used in their image file? For example if you only used 4 colours and hence image was 2 bitplanes, would cocos2d show and manipulate these quicker than a 24 bit colour sprite? ...

Applet stops at "Applet loaded" and displays nothing, works perfectly on BlueJ AppletViewer.

Background:  I have a basic applet from various tutorials and books written that adheres to their instructions and, after much toil over getting it to display anything at all, I finally have it so that it displays fine in Applet viewer. It has 3 classes: Animation, Sprite, and spriteTest. Animation and Sprite classes have been thorough...

Can we got a dynamic cursor in Flex 4 with the CursorManager ?

Hi, I want a custom cursor I can edit in the .mxml file. For the moment I got a static one with a class extends Sprite. Is for a SketchPad application, the cursor will be the color and the size of the user choice. Let me know if it possible and how. Here the class in a .as file : package project { import flash.display.Sprite; ...

Where does the .x and .y property of a Sprite in actionscript 3.0 measured from? from the centre of the object? or.....?

Hi all, Where does the .x and .y property of a movieclip in actionscript 3.0 measured from? from the centre of the object? or.....? For instance, given a pro grammatically drawn Sprite: graphics.beginFill(0x000000); graphics.moveTo(9.00000000,-7.00000000); graphics.lineTo(13.00000000,0.00000000); gr...

How can I change the color of a sprite without changing the color of the border?

I have this code public function TalentBox(x:int, y:int, arg_color:int = 0xFFFFFF):void { this.graphics.beginFill(arg_color); this.graphics.lineStyle(1.0, 0x000000, 0.7); this.graphics.drawRect(0, 0, 7, 13); this.alpha = 1.0; this.x = x; this.y = y; this.graphics.endFill(); } Where I construct the class (th...

Animating large sprites with cocos2d (ccspritesheet)

I'm working on an iPhone game using Cocos2d where the main character is approximately 194x114. the animation consists of 100+ frames making my spritesheets larger than the 1024x1024 limit. The obvious solution would be to separate the animation to several files and swapping spritesheets when necessary. while doable (i guess) i'm not qui...

Cocos2d IPhone sprite problem

The problem is - when i load game on iphone some sprites are shown, some are not, plus CCBitmapFontAtlas labels and CCMenu button are also not visible and when i tap on the place where button have to be - there is no effect. At simulator it worked just fine. What is the reason of such strange situation? IPad aslo works ok. ...

transparent parts of sprite responding to mouse events

I'm making a puzzle game in Flash cs5/as3 which can have custom puzzle shapes. Basically, the user can draw basic protrusions of a puzzle. Then I create a black and white puzzle piece with a custom function like this var piece:PuzzlePiece= new PuzzlePiece(true,true,false,false); PuzzlePiece is a class that extends Sprite. The four arg...