It is currently Fri May 24, 2013 10:26 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ZoomSprite() without Sprite3D
PostPosted: Fri Jul 29, 2011 5:05 am 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 1620
Location: USA
Here's the procedure and an example to download. ;)

DOWNLOAD EXAMPLE

Code:
Structure ZoomSpriteCalculations
  SavedSpriteWidth.f
  SavedSpriteHeight.f
  SaveData.l
EndStructure

Procedure ZoomSprite(Sprite, SpriteWidth.f, SpriteHeight.f)

  Static Dim SpriteZoom.ZoomSpriteCalculations(99)
 
  If SpriteZoom(Sprite)\SaveData = 0
   
      SpriteZoom(Sprite)\SavedSpriteWidth = SpriteWidth
      SpriteZoom(Sprite)\SavedSpriteHeight = SpriteHeight
     
       CreateSprite(Sprite, SpriteWidth, SpriteHeight)
 
        StartDrawing(SpriteOutput(Sprite))
          DrawImage(ImageID(Sprite), 0, 0, SpriteWidth, SpriteHeight)
         StopDrawing()
         
       SpriteZoom(Sprite)\SaveData = 1
  EndIf
 
  If SpriteZoom(Sprite)\SavedSpriteWidth <> SpriteWidth Or SpriteZoom(Sprite)\SavedSpriteHeight <> SpriteHeight
    SpriteZoom(Sprite)\SaveData = 0
  EndIf
 
EndProcedure

_________________
AMD 64 4000+ / 1GB PC2700 / WIN XP Home SP3 / Nvidia GT220 x16 512MB / M-Audio Revolution 5.1
Macbook Air 11.6" - 2010 / OS X 10.8

http://www.posemotion.com
http://www.flashpulse.com


Top
 Profile  
 
 Post subject: Re: ZoomSprite() without Sprite3D
PostPosted: Fri Jul 29, 2011 6:24 am 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 1620
Location: USA
If you are using windows, I just noticed Library Subsystem: DirectX7 gives better results when zooming.

_________________
AMD 64 4000+ / 1GB PC2700 / WIN XP Home SP3 / Nvidia GT220 x16 512MB / M-Audio Revolution 5.1
Macbook Air 11.6" - 2010 / OS X 10.8

http://www.posemotion.com
http://www.flashpulse.com


Top
 Profile  
 
 Post subject: Re: ZoomSprite() without Sprite3D
PostPosted: Fri Jul 29, 2011 1:15 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
Not a good trick / tip.
The procedure is much too slow for the application.
The procedure works only with sprite numbers 0-99 ... and there is no check whether sprite is within a range of 0-99
but many use random numbers with #PB_Any
why you not use a Map like SpriteZoom(Str(Sprite))?

_________________
Image


Top
 Profile  
 
 Post subject: Re: ZoomSprite() without Sprite3D
PostPosted: Fri Jul 29, 2011 8:38 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 1620
Location: USA
STARGÅTE wrote:
Not a good trick / tip.
The procedure is much too slow for the application.
The procedure works only with sprite numbers 0-99 ... and there is no check whether sprite is within a range of 0-99
but many use random numbers with #PB_Any
why you not use a Map like SpriteZoom(Str(Sprite))?

I simply showed that it can be done. You are welcome to do with it how ever you want. ;)

_________________
AMD 64 4000+ / 1GB PC2700 / WIN XP Home SP3 / Nvidia GT220 x16 512MB / M-Audio Revolution 5.1
Macbook Air 11.6" - 2010 / OS X 10.8

http://www.posemotion.com
http://www.flashpulse.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye