View previous topic :: View next topic |
Author |
Message |
ipivb Master Cheater
Reputation: 5
Joined: 29 May 2010 Posts: 256
|
Posted: Thu Jun 17, 2010 3:31 am Post subject: radar Calculation help |
|
|
hello everyone,
im trying to make a radar for a game but don't know how to re-map the game's scale x,y to my forms scale x,y the game's scale is
Code: |
Float Values
x Top =-12
x Bottom =12
|
Code: |
Float Values
Y Top =-12
Y Bottom =12
|
and say my form is
Code: |
Width - 300
Height - 300
|
so say i was in game and i was in the middle of the map my x,y would be
so how would i say get a picturebox to move with the x,y so it would go to the middle of my form
if anyone could show some sample code on how to do the calculations that would be great! [/b]
im programming in
vb.net but if you have some codes in another language post them anyways it would help me
|
|
Back to top |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Thu Jun 17, 2010 3:42 am Post subject: |
|
|
I'm not sure what you're asking on the second part, but I just googled "stretching a picture in picturebox VB" and got a lot of good results for you(I assumed there would be a method already made for you for this, just like in Delphi there is one for the TBitmap, which is, from what I can tell, the picturebox equivelant.)
Most answers related to this question would need more information on what all you're doing with the game (reading by memory, reading pixel by pixel, are you making your own radar from scratch or are you modifying theirs or maybe making a radar to be able to look at while the game is minimized, etc etc) Similarly I can't tell what you mean about the "get a picturebox to move with the x,y so it would go to the middle of my form"
_________________
|
|
Back to top |
|
 |
zile Advanced Cheater
Reputation: 0
Joined: 11 Jul 2009 Posts: 75
|
Posted: Thu Jun 17, 2010 4:01 am Post subject: |
|
|
if im not misunderstood by your question
you need to do something like MyXCoord/12*150
drawing a diagram helps
|
|
Back to top |
|
 |
ipivb Master Cheater
Reputation: 5
Joined: 29 May 2010 Posts: 256
|
Posted: Thu Jun 17, 2010 4:59 am Post subject: |
|
|
Uzeil wrote: | I'm not sure what you're asking on the second part, but I just googled "stretching a picture in picturebox VB" and got a lot of good results for you(I assumed there would be a method already made for you for this, just like in Delphi there is one for the TBitmap, which is, from what I can tell, the picturebox equivelant.)
Most answers related to this question would need more information on what all you're doing with the game (reading by memory, reading pixel by pixel, are you making your own radar from scratch or are you modifying theirs or maybe making a radar to be able to look at while the game is minimized, etc etc) Similarly I can't tell what you mean about the "get a picturebox to move with the x,y so it would go to the middle of my form" |
lol sorry i am making a radar that will show there position as a picturebox i am reading the memory of there x,y and trying to figure out how i could position that picture box to the the exact location on my form as to the game
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu Jun 17, 2010 5:25 am Post subject: |
|
|
find the height and width of the radar in game. if the top left corner is -64y, -64x then the absolute value of that is the opposite, 64y, 64x. so it's 128 in height and width.
the easiest way would be to match your representation to it would be to just 1:1 or 1:2, etc. in a way that scales easily.
then all you'd need to do is add half the total of the radar.
|
|
Back to top |
|
 |
ipivb Master Cheater
Reputation: 5
Joined: 29 May 2010 Posts: 256
|
Posted: Thu Jun 17, 2010 8:09 am Post subject: |
|
|
thanks guys got it =] C0deSlinger helped me alot
Code: | converterdx.Text = -15.33 * playerX.Text |
|
|
Back to top |
|
 |
|