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 / Object Positioning

Author
Message
maptwo3
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 6th Dec 2011 21:27 Edited at: 6th Dec 2011 23:02
So I'm pretty new to Dark GDK and I was writing a function that takes an x and y position in pixels, and places a rectangle there.

The problem I'm finding is that objects like that take in -1 - 1 to be positioned in the screen.

Right now I am placing the rectangle in the X position of 500 pixels and the middle of the screen for Y, but I would like that to be changeable, without editing the function.

I would also like to scale it according to what Size the user inputs.

Hopefully someone can help.



Edit:
I found a way to do it by creating a sprite, which is how I actually wanted to in the first place. I have a plain white jpg that is 75x25 pixels big. I want to create a button with this function, and I would like to be able to scale the the sprite and the text, and place them in the right spots with this function. This is what I have so far:
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 7th Dec 2011 13:02 Edited at: 7th Dec 2011 13:03

never use either of them in a loop, for text in it just add a dbText, please specify the problem if you have any, "this is my code" is annoying without a problem :s

also, you don't need dbDrawSpritesFirst every loop

Login to post a reply

Server time is: 2024-04-25 05:55:44
Your offset time is: 2024-04-25 05:55:44