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.

Newcomers DBPro Corner / assistance with tutorial 8 of help files and grab image

Author
Message
comploser
21
Years of Service
User Offline
Joined: 25th Dec 2002
Location:
Posted: 27th Dec 2002 19:47
OKay, I am sort of cramming two issues into one post, so please tell which you are replying to if you choose to reply. I am using DarkBASIC 3d games creator.Alright:
Issue 1) Grabbing an image. How do you know what you are grabbing? Is there some way to find coordinates and image size? Because I dont know what I am grabbing in text, which means I have to guess. I know that I could get it by trial and error, but I would prefer an alternative.
Issue 2) On tutorial 8 of the 3D Games Creator set, it teaches sprites. I would like someone to better explain to me this code, and how it works:

Load bitmap "runner.bmp"
For y=0 to 1
For x=0 to 6
Get image 1+x+(y*7),(x*89),(y*120),(x*89)+89,(y*120)+120
Next x
next y

why all the multiples? How does this identify what this is grabbing?

The reason why I put both of these in the same post is because they both deal with grabbing.

I would like to thank everyone for their time.
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 29th Dec 2002 18:20
Issue 1 - I usually use 1 bitmap per image as it is easier to find the size of the whole bitmap rather than a bit of it. I use ms paint to find the size of the bitmap (click on attributes i the image menu). Im sure other programs have a similar option.

Isuue 2 - This code is really to save having to write out 14 get images, instead it uses a for next loop and grabs the image using maths. The variable in the get image line is the image number,it adds 1 to the image number every time it goes through a loop. The next 4 variables move the coordinates and the area its grabbing along 89 and down 120 (the size of the image) each time it goes through the loop.
Ill do 3 examples, replacing the letters with numbers

1. (x=0,y=0)
get image 1+0+0*7,0*89,0*120,0*89+89,0*120+120 simplifies to...
get image 1,0,0,89,120

2. (x=1,y=0)
get image 1+1+0*7,1*89,0*120,1*89+89,0*120+120 simplifies to...
get image 2,89,0,178,0

8. (x=0,y=1)
get image 1+0+1*7,0*89,1*120,0*89+89,1*120+120 simplifies to...
get image 8,0,120,89,240

It just changes the grab coordinates by changing x and y
Hope I helped.

Yum! Yum! Yum! Yum!
Epidemicz
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 30th Dec 2002 21:25
wtf are all the *'s doing in there anyway?

I am the very disease you pretend to be.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 30th Dec 2002 22:18
That means multiply

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
soap_shoes
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United States
Posted: 31st Dec 2002 02:41
hey im not a noob! ......hmm......

noobie game designer

Login to post a reply

Server time is: 2024-11-23 19:39:39
Your offset time is: 2024-11-23 19:39:39