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.

2D All the way! / Get Image command

Author
Message
Riz
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location:
Posted: 24th Mar 2009 01:46
Hi, im a real noob and i could use some serious help could someone please explain how the "get image" command works? your help is appreciated
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 24th Mar 2009 06:04 Edited at: 24th Mar 2009 06:06
Well for dbc,

Get image ImageNumber,X1,Y1,X2,Y2

Imagenumber:
the number of the image to get
X1:
Left side of the box you want to get
Y1
Top of the box you want to get
X2
Right side of the box you want to get
Y2
Bottom of the box you want to get


So

Y1
|---------|
|---------|
X1 |---------| X2
|---------|
|---------|
Y2

or you could think of it as X1,Y1 is the top/left corner of the box and X2,Y2 is the bottom/right corner of the box

New Site! Check it out \/
Riz
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location:
Posted: 26th Mar 2009 23:33
thanks dude
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 29th Mar 2009 00:30 Edited at: 2nd Apr 2009 00:37
Not sure about dbc but dbpro usage is slight different.

It is GET IMAGE img,X1,Y1,X2,Y2,FLAG

where;

X1 = left
Y1 = top
X2 = right (but should be one more that you think)
Y2 = bottom (but should be one more than you think)
FLAG = set to 1 to grab the image pixel perfect. If you exclude the flag or use 0 it will get the image blurred, ie it will grab it for use in 3D models with mipmaps.

So using GET IMAGE 0,0,63,63,1 is what you would expect to grab a 64 by 64 pixel image but actually grabs a 63 by 63 image. So you must use 0,0,64,64,1

[EDIT] Edited to fix my stupid typos. Thanks Scraggle!

Boo!
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 29th Mar 2009 09:43
It's the same on dbpro. He just left out the flag part, since it is optional.

My eyes hurt. And AUS rocks. More people should try making quality 2d games.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 1st Apr 2009 20:28
Quote: "X1 = top
Y1 = left
X2 = bottom (but should be one more that you think)
Y2 = right (but should be one more than you think)"


You seem to have got your X's and Y's mixed up spooky. I'm sure that was an accidental slip on your part, but for anyone that isn't sure ... Use X for left/right and Y for up/down.



spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 2nd Apr 2009 00:38
Doh!

Boo!

Login to post a reply

Server time is: 2024-03-29 10:56:41
Your offset time is: 2024-03-29 10:56:41