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.

Dark GDK / Bitmap drawing

Author
Message
xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 3rd Feb 2012 01:01
Ok, so I want to make a simple GUI for my game and so I wanted to use bitmap sprites to do so. My question is, how do I place a bitmap that I have drawn to on the screen? My code so far is:



This function is, of course, incomplete, because I can't figure out how to place the bitmap on the screen once I draw to it. I would assume that my only option is to save it to a file then load it as an image?? That will take quite a while and I don't want performance to suffer for this.
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 3rd Feb 2012 02:47
I would use sprites myself.



If you want to stick to your current approach, try



Hope this helps,

JTK
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 3rd Feb 2012 03:03
When you create a bitmap the current bitmap is already set to that bitmap. Be sure to set the bitmap back to the 0 when your want to draw to the screen again. Use this command to get the image. The last parameter will prevent the image from stretching.

dbGetImage ( imgID, 0, 0, x_size, y_size, 1 );
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 3rd Feb 2012 11:07
Am I correct in assuming that GDK DB code is simply adding db to the front so this could work in DBPro as well?

JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 3rd Feb 2012 14:22
For the most part, that is correct. There may be a few commands that don't follow the pattern, so I can't say its absolutely true. I've not found any yet, but still... There may be a few. In fact, when Gdk documentation isn't clear enough, I pull up dbp and gain better clarification through its help system...
xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 3rd Feb 2012 21:47
I had planned on using the images as sprites. The code wasn't finished because I couldn't figure out how to use the bitmaps as images to make the sprites I figured it out late last night but thanks anyways guys!

Login to post a reply

Server time is: 2024-11-22 23:55:29
Your offset time is: 2024-11-22 23:55:29