Page 3 of 3

Re: Any idea on how to rotate sprites?

Posted: Tue Jan 28, 2014 7:38 pm
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

Re: Any idea on how to rotate sprites?

Posted: Tue Jan 28, 2014 7:54 pm
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

Re: Any idea on how to rotate sprites?

Posted: Tue Jan 28, 2014 8:10 pm
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.

Re: Any idea on how to rotate sprites?

Posted: Wed Jan 29, 2014 1:00 am
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

Re: Any idea on how to rotate sprites?

Posted: Wed Feb 05, 2014 12:08 am
by em_uk
nice code Danilo.