Posted 21 May 2013 - 05:15 PM
I just got back to a program I was working on a few weeks ago which is a button api so I can easily make buttons or boxes and center the text and all that stuff that is usually involved with buttons. I have most of it working but I have one problem that I can't figure out with the part that centers the text. I'm pretty sure I am doing something wrong with the text centering on the X axis. This is what is looks like when just putting a button at 1,1:
However when I try to put a button next to it, things get a bit wonky:
The text from the second button next to it is put in an unexpected place. I worked out the math with the specific coordinates and that is exactly where the text is supposed to be according to the code/math.
API:
http://pastebin.com/KgBJMtBg
Code used to run it:
http://pastebin.com/w0bxsynv
If someone could please take the time to read my code and try to figure out what is wrong, that would be great.
Help is appreciated!
Thanks! :D/>
However when I try to put a button next to it, things get a bit wonky:
The text from the second button next to it is put in an unexpected place. I worked out the math with the specific coordinates and that is exactly where the text is supposed to be according to the code/math.
API:
http://pastebin.com/KgBJMtBg
Code used to run it:
http://pastebin.com/w0bxsynv
If someone could please take the time to read my code and try to figure out what is wrong, that would be great.
Help is appreciated!
Thanks! :D/>