Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

how to draw circle in minimap?


Best Answer Inspired , 12 November 2015 - 05:05

For the general drawing of 2D circles you can use:

function DrawScreenCircle(x, y, size, width, color, quality, elliptic)
    local quality = quality or 1;
    local elliptic = elliptic or 1;
    for theta=0,360,quality do
      DrawLine(x + size * math.cos(2*math.pi/360*theta), y - elliptic * size * math.sin(2*math.pi/360*theta), x + size * math.cos(2*math.pi/360*(theta-1)), y - elliptic * size * math.sin(2*math.pi/360*(theta-1)), 1, color)
    end
end
Go to the full post »


  • Please log in to reply
15 replies to this topic

#1
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

so sad someone lock my post :dogecry:

http://gamingonstero...minimap-broken/

 

 

as title

 

i want draw a circle like this

UDKtBKP.png

 

 

WorldToMinimap only return x, y

 

but DrawCircle need x,y,z


  • 0

#2
Inspired

Inspired

    Took the red pill.

  • Ex-Core Dev
  • PipPipPip
  • 723 posts
  • LocationWonderland

so sad someone lock my post :dogecry:
http://gamingonstero...minimap-broken/
 
 
as title
 
i want draw a circle like this
UDKtBKP.png
 
 
WorldToMinimap only return x, y
 
but DrawCircle need x,y,z

DrawText("o" ....

:fappa:


Otherwise construct it with ****ton lines.
  • 1

#3
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

DrawText("o" ....

:fappa:


Otherwise construct it with ****ton lines.

genius Kreygasm


  • 0

#4
Cloud

Cloud

    KAPPA

  • Ex-Staff
  • PipPipPip
  • 1,498 posts

genius Kreygasm

Im not sure but you could 

DrawText("•")

  • 0

#5
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

 

Im not sure but you could 

DrawText("•")

i tried it, nope, + you need ASCII format for it :fappa:


  • 0

#6
Maxxxel

Maxxxel

    The One

  • Scripts Developer
  • 1,196 posts
  • LocationGuess the right City to win 10$

Get Screen Resolution and u have the Map position


  • 0

#7
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

Get Screen Resolution and u have the Map position

some sample code plz? BabyRage


  • 0

#8
Maxxxel

Maxxxel

    The One

  • Scripts Developer
  • 1,196 posts
  • LocationGuess the right City to win 10$

not yet. i try to make one weekend maybe


  • 0

#9
Maxxxel

Maxxxel

    The One

  • Scripts Developer
  • 1,196 posts
  • LocationGuess the right City to win 10$

Something like Set 2 corners(upper left and down right corner of the minimap, by left click) once u start the script and project the 3D environment to this "new" set rectangle crated by these 2 corners.

 

Transform the 3D coordinate of an Unit to a 2D coordinate of this rectangle u set. U need to do math.


  • 0

#10
Inspired

Inspired

    Took the red pill.

  • Ex-Core Dev
  • PipPipPip
  • 723 posts
  • LocationWonderland

Something like Set 2 corners(upper left and down right corner of the minimap, by left click) once u start the script and project the 3D environment to this "new" set rectangle crated by these 2 corners.

 

Transform the 3D coordinate of an Unit to a 2D coordinate of this rectangle u set. U need to do math.

Or you use WorldToMinimap


  • 0

#11
Maxxxel

Maxxxel

    The One

  • Scripts Developer
  • 1,196 posts
  • LocationGuess the right City to win 10$

Or you use WorldToMinimap

i thought this isnt working thats why he/she asked?


  • 0

#12
Feretorix

Feretorix

    Administrator

  • Administrators
  • 3,016 posts

Just wait for me to release one api like that, there's nothing else better left to do.


  • 0

#13
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

Just wait for me to release one api like that, there's nothing else better left to do.

:dogecry:


  • 0

#14
Inspired

Inspired

    Took the red pill.

  • Ex-Core Dev
  • PipPipPip
  • 723 posts
  • LocationWonderland
✓  Best Answer
For the general drawing of 2D circles you can use:
function DrawScreenCircle(x, y, size, width, color, quality, elliptic)
    local quality = quality or 1;
    local elliptic = elliptic or 1;
    for theta=0,360,quality do
      DrawLine(x + size * math.cos(2*math.pi/360*theta), y - elliptic * size * math.sin(2*math.pi/360*theta), x + size * math.cos(2*math.pi/360*(theta-1)), y - elliptic * size * math.sin(2*math.pi/360*(theta-1)), 1, color)
    end
end

  • 0

#15
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

For the general drawing of 2D circles you can use:

function DrawScreenCircle(x, y, size, width, color, quality, elliptic)
    local quality = quality or 1;
    local elliptic = elliptic or 1;
    for theta=0,360,quality do
      DrawLine(x + size * math.cos(2*math.pi/360*theta), y - elliptic * size * math.sin(2*math.pi/360*theta), x + size * math.cos(2*math.pi/360*(theta-1)), y - elliptic * size * math.sin(2*math.pi/360*(theta-1)), 1, color)
    end
end

hmm since we have DrawCircleMinimap api already....i think i don't need those math anymore :D


  • 0

#16
Inspired

Inspired

    Took the red pill.

  • Ex-Core Dev
  • PipPipPip
  • 723 posts
  • LocationWonderland

hmm since we have DrawCircleMinimap api already....i think i don't need those math anymore :D

Well this works on complete screen, not just on the minimap. (I needed it for my pong huehue)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users