NOGDUS
December 17, 2018, 01:44:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Blogs Help Search Tags Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: Rotation sprite  (Read 11869 times)
0 Members and 1 Guest are viewing this topic.
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« on: May 31, 2010, 02:14:25 PM »

Question sprite. How rotate sprite?
Position ok - sprX_=10; sprY_=20;
How redaction angle (or direction) sprites?   
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #1 on: May 31, 2010, 03:38:34 PM »

In the current release of Pixie (version 0.9d) sprites can't be rotated. The next Pixie release (version 1.0) will have support for rotating sprites (as can be seen here) as well as multiple and custom blend modes.

(So far I haven't needed much rotation, and for the few times I did, I've just made do with rotating the sprites in an image editor and saving out as multiple frames. But for the Racing game I needed rotation, and I'll make it available in the next release)
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #2 on: June 01, 2010, 01:16:17 AM »

And when release 1.0 is planned?
Object turn means it is necessary to do by animation?
On how many easily there passes migration of projects on new versions?
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #3 on: June 01, 2010, 01:14:09 PM »

I don't have a set date for the next release - but hopefully sometime after the summer.

In the current version (0.9d) you have to use animations to rotate. In the next version you will be able to rotate by just setting the rotation angle on the sprite.

To upgrade your project to a new Pixie version will involve *some* work, as I will have changed some systems. I don't think it will be all that much work to upgrade from using 0.9d to using 1.0 though, as most changes are either additions or back-end/implementation changes.
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #4 on: June 03, 2010, 01:28:52 AM »

Whether exists before loading of resources?
The question has arisen, as at change sprite game brakes.
method: Setbitmap("..\image.png");
Whether exists "Manager resource" or "Manager Sprites"? If yes, how to use?
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #5 on: June 03, 2010, 11:53:57 PM »

Sad
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #6 on: June 05, 2010, 12:44:51 AM »

I'm not sure what your problem is. There is both a sprite manager and a resource manager, but you shouldn't need to use them directly (they are both in use in the tutorial samples). Could you provide more details?
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #7 on: June 05, 2010, 01:17:47 PM »

Probably I have missed something.
Details: By pressing a key, there is a change sprites. 5 images are used. The structure approximately following, is applied switch case1, case2..., case5. Images are replaced consistently at button deduction. At the moment of change of the image, game process loses FPS. It is probably necessary to load all images into memory, and after already remove to work. 5 cases, 5 commands of loading are now applied on all:
case 1:
spr.setbitmap ("../data/1.png");
break;
case 2:
spr.setbitmap ("../data/2.png");
break;
Etc.
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #8 on: June 06, 2010, 11:55:45 AM »

Oh, ok, you see a slowdown in FPS when you change the bitmap? That's easily fixed.
 
Put some code like this in before you enter the main game loop:

Code:
siResourceManager->LoadBitmapStrip("Data/1.png");
siResourceManager->LoadBitmapStrip("Data/2.png");

Which will make sure that the images stay loaded until you unload them, and switching images will be fast (if you don't do this, the bitmap will be loaded from file everytime you switch).

To unload images, put this code after you exit the game loop:
Code:
siResourceManager->UnloadBitmapStrip("Data/1.png");
siResourceManager->UnloadBitmapStrip("Data/2.png");

If you want to speed up both the loading time and rendering of images, you should convert them from PNG to Pixie's own image format PIX. In the PixieLib folder there's a program called PixiePCT, and if you drag your PNG to one of the .bat files (for example, "RLE8 dither.bat", it will produce a .PIX file which you can use instead. (There's also a program called PixView, which can be used to view .PIX files).

Also, the "Strip ...bat" versions can take several PNG files and put them together into one .PIX file, and if you use that file on a sprite ( spr.setbitmap("img.pix"); ), you can call something like spr.SetCel(spr.GetCel()+deltaTime) to animate between those images.

Remember, that the source code of the example games (http://pixieuniversity.com/downloads.php) are very good for reference on how to do various things in Pixie.
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #9 on: June 06, 2010, 11:33:51 PM »

Perfectly! Many thanks Smiley
I am sorry for a considerable quantity of questions.
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #10 on: June 07, 2010, 06:30:02 AM »

No worries, I don't mind the questions - helps me to know what to write better documentation for :-)
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #11 on: June 07, 2010, 01:55:38 PM »

Perfectly! High-grade mutual aid it is good)))
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #12 on: August 16, 2010, 11:50:38 PM »

And how to convert png in PIX? Than? A question 2: For what these programs: PixieAGT PixiePCT PixieFGT? If among them there is a converter in PIX as it to use?
Logged
bedndarc
Member
*

Respect: 0
Offline Offline

Posts: 58



« Reply #13 on: August 20, 2010, 01:58:21 PM »

Mattias, You are live?)))
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #14 on: August 21, 2010, 03:29:56 PM »

Yes, sorry - it's PixiePCT (Picture Conversion Tool). Just drag a bunch of PNG (or TGA or JPG or GIF) onto the "RLE8.bat" file, and it will convert each of them into a PIX file. If you drag a bunch of image files onto the "Strip RLE8.bat" file, it will convert all of them into one animated PIX file (you can animate it in Pixie by calling SetCel on the sprite using it).
Logged
Tags:
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!