Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Image from a sprite

Author
Message
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 23rd Jun 2009 05:53
Ok, say for instance I make an image, then make a sprite from the image, then flip the sprite, how could i turn that sprite back into an image.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd Jun 2009 06:20
what i would do is make a function that would flip/mirror the IMAGE using either memblocks if you understand em or point() if you dont

There are only 10 kinds of people in the world, those who understand binary and those who dont
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 23rd Jun 2009 11:45 Edited at: 23rd Jun 2009 11:45
Memblocks = Tricky. A far simpler method is this:

Firstly, I assume you know how big your image is. If not, then I think you can find out using "Sprite Width()" and "Sprite Height()".



"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Jun 2009 12:00
I'm gonna chime in here too with even another alternative.

If the goal is ultimately to get a flipped image from an image then:



Enjoy your day.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 23rd Jun 2009 12:00
I would agree with robert the robot. Paste sprite and get image again is infinitely simpler than memblocks.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd Jun 2009 17:40
maybe...... but not near as fun!!

There are only 10 kinds of people in the world, those who understand binary and those who dont
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 23rd Jun 2009 18:11
lol doh, didn't realize there was a paste command for sprites, wow I feel stupid.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd Jun 2009 20:52
its ok i didnt either

There are only 10 kinds of people in the world, those who understand binary and those who dont
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 24th Jun 2009 20:39
I didn't realise "paste sprite" was there either, until I read a newsletter article about anaglyph 3D support for DBpro where they used it quite a bit.

There's not really much need for a paste sprite command - most of the time you're changing the image used to create an animated look. Paste sprite is only really worthwhile if the image will never change. Could be useful though.

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Jun 2009 23:37
You hide the sprite and paste it so you can have things in front of whatever your pasting. Like if you want a spaceship to be under the current score you paste it then write the score. You keep it a sprite hidden so you can still do sprite collision checks.

Login to post a reply

Server time is: 2024-05-20 12:37:27
Your offset time is: 2024-05-20 12:37:27