Resize sprites

Advanced game related topics
robert1352
User
User
Posts: 34
Joined: Tue Mar 14, 2006 8:17 pm

Resize sprites

Post by robert1352 »

Hi everyone,does anyone know of a way to resize your sprites?? Is there a command for that? If there is I cant seem to find it. Thanks for your help. :wink:
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

2D Sprite or 3D Sprite?
BERESHEIT
robert1352
User
User
Posts: 34
Joined: Tue Mar 14, 2006 8:17 pm

reply

Post by robert1352 »

2-D sprites :)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Just one more question, what is the reason for the resize?
BERESHEIT
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

netmaestro wrote:Just one more question, what is the reason for the resize?
Lol?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

The reason matters as there are a couple of ways to approach it depending on how many sprites need resized and in what circumstances.
BERESHEIT
robert1352
User
User
Posts: 34
Joined: Tue Mar 14, 2006 8:17 pm

Resize sprite

Post by robert1352 »

The reason I need to resize my sprite is that for the game Im making the sprites I have avalible to me seem too large, I would like to make them a little smaller.Thank you for your help!! [/quote]
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

In that case I suggest you:

Code: Select all


InitSprite()
OpenScreen(...)
CatchImage(#image, ?Sprite1)
ResizeImage(#image, newsize, newsize, #PB_Image_Smooth)
CreateSprite(#sprite, newsize, newsize)
StartDrawing(SpriteOutput(#sprite))
  DrawImage(ImageID(#image), 0, 0)
StopDrawing()

;...program stuff

DataSection
  Sprite1: IncludeBinary "<path to the sprite image>"
EndDataSection
BERESHEIT
robert1352
User
User
Posts: 34
Joined: Tue Mar 14, 2006 8:17 pm

Thank you

Post by robert1352 »

Thank you very much Ill give your idea a try and let you know how it works out :)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Resize sprite

Post by Trond »

robert1352 wrote:The reason I need to resize my sprite is that for the game Im making the sprites I have avalible to me seem too large, I would like to make them a little smaller.Thank you for your help!!
[/quote]Then you should resize them before you load them.
robert1352
User
User
Posts: 34
Joined: Tue Mar 14, 2006 8:17 pm

thank you

Post by robert1352 »

Thanks everyone for all of your help :)
Post Reply