Code:
Problem description:
How to get the x position of the above blank icon slots? I only need x, not y?
Regards.
Jan 26 2013, 9:36 am
|
|
Look at screen_loc. Get the values after the first : until the ,
|
Burael wrote:
Code: >
I'm not sure exactly what you're asking so I will ask you to clarify... Do you want to find the x pixel value of the black square in the image you posted, as in the image is actually loaded in game and you want to trace each pixel until you find the first black pixel and then store that value for use? Do you want to know how to put an atom in the position of the black boxes? The fact that you only need X and not Y leads me to believe you're doing something tricky that we need to know about because to find x would be the same process of finding y. screen_loc formatting works like this screen_loc = "x:offset_x,y:offset_y" x and y are in tile units offset_x and offset_y are in pixel units If you want to use absolute pixel units, make your X and Y just 1 screen_loc = "1:345,1:879" If you need to extract this information from a screen_loc variable for reading, you'll need to do some text operations... Otherwise, keep track of this data your self and just rebuild the screen_loc from scratch every time you need to change it. obj/var Doing it this way comes with some responsibility. You gotta make sure you actually use those variables, and that you actually call update_screen_loc(). |
I am trying to place an atom (hud object) at the position of those slots on mouse enter. That is working fine, but my problem is this -
What I want to do is, check if the x value is bigger than xx, than position it like this - First image is how it works ingame now. Second one is how I want it to be. I think FIREking solution will do it. Thanks for reply, Regards. |