Any idea on how to rotate sprites?

Advanced game related topics
barryem
User
User
Posts: 19
Joined: Mon Jan 27, 2014 2:40 am

Re: Any idea on how to rotate sprites?

Post by barryem »

Thanks. That worked!! :)

I keep running into other things that don't work. The sprite program I was trying out before I found this thread referred to #PB_Sprite_Texture, for which I get a Constant Not Found error. I can't recall where I found that program now. Is that a constant that was declared in an earlier version?

Here's the line of code:

Code: Select all

LoadSprite(1,"needle.bmp",#PB_Sprite_Texture) 
That's just an example of the things I keep running into. I mentioned it because that program was still in the PB editor. Is there any list of undeclared constants and functions from other versions and what to do about them, if that's what this actually is.

This isn't a serious problem for me. I'm trying to learn something about PureBasic and studying code and playing with what changes do is one of the ways I like to learn a new language. There is a lot of sample code that does work. It just gets frustrating when so many that seem to have stuff to teach me don't work. It would be nice to get some kind of reference for this.

Barry
barryem
User
User
Posts: 19
Joined: Mon Jan 27, 2014 2:40 am

Re: Any idea on how to rotate sprites?

Post by barryem »

I halfway answered my question by comparing the modified code you left with the original. Using those differences I was able to make the other source I'd been looking at compile and run but not correctly. Not sure why. It doesn't matter, really. It's just some sample I found somewhere. But some kind of reference to changes would really be useful.

Barry
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Any idea on how to rotate sprites?

Post by Danilo »

#PB_Sprite_Texture was used before. Sprite3D required it. Now all sprites are textures internally.
barryem wrote:But some kind of reference to changes would really be useful.
PB help has a history section which lists most of the big changes of any version.

For example:

Code: Select all

17th September 2013 : Version 5.20 LTS
[...]
- Added: ZoomSprite() now accepts #PB_Default as Width/Height to reset to initial sprite size 
- Added: 'Color' and 'Intensity' parameter to DisplayTransparentSprite() 
- Added: ClipSprite() now support #PB_Default for individual parameter 
- Added: #PB_Sprite_PixelCollision flag to CreateSprite(), LoadSprite() to enable pixel collision 
- Added: Zoom support to SpritePixelCollision() and SpriteCollision()
[...]
- Changed: renamed ZoomSprite3D() to ZoomSprite() 
- Changed: renamed TransformSprite3D() to TransformSprite() 
- Changed: renamed RotateSprite3D() to RotateSprite() 
- Changed: renamed Sprite3DQuality() to SpriteQuality() 
- Changed: renamed Sprite3DBlending() to SpriteBlending()
[...]
- Removed: Sprite3D library (merged with regular sprite library) 
- Removed: Palette library (outdated) 
- Removed: UnPackMemory() -> replaced with UnCompressMemory() 
- Removed: RenderMovieFrame() and #PB_Movie_Rendered (outdated) 
- Removed: DisplayTranslucentSprite() -> replaced with 'Alpha' parameter for DisplayTransparentSprite() 
- Removed: DisplaySolidSprite() -> replaced with 'Color' parameter for DisplayTransparentSprite() 
- Removed: DisplayRGBFilter() -> can be replaced with a zoomed sprite with color 
- Removed: DisplayShadowSprite() -> can be replaced with DisplayTransparentSprite() with color 
- Removed: StartSpecialFX(), StopSpecialFX(), DisplayAlphaSprite(), ChangeAlphaIntensity(), UseBuffer()
I understand it may be very hard to get started, when so many old codes don't work anymore.

You can download older versions of PureBasic in your PureBasic user account (Museum). Maybe get last 4.x and 3.x version.
Install it beside current PB and add this directories to your PB5.21 IDE preferences (Preferences -> Compiler).
If a code doesn't work anymore, you could switch compiler settings easily to use one of the older compilers.
barryem
User
User
Posts: 19
Joined: Mon Jan 27, 2014 2:40 am

Re: Any idea on how to rotate sprites?

Post by barryem »

Thanks for your help. I'll get another compiler or two and see how that goes. And I'll look into that history.

Barry
User avatar
em_uk
Enthusiast
Enthusiast
Posts: 366
Joined: Sun Aug 08, 2010 3:32 pm
Location: Manchester UK

Re: Any idea on how to rotate sprites?

Post by em_uk »

nice code Danilo.
----

R Tape loading error, 0:1
Post Reply