0

I've been trying to get this concept UI design working in the game:

Concept UI Design

I got the health display just fine. Then I tried to add the orbs in and here's how far I've got it so far:

What I've got

The orbs are getting drawn in the correct place but in the wrong order. The first one getting drawn is the dark red orb and white is the last. I need it to start drawing the first orb (dark red) at the bottom of the health display and then making its way counter-clockwise.

Here's the code:

//Mana UI
for (var i=0; i<5; i++)
{
    draw_sprite(spr_mana_orb, 0, _centerx+28*cos(i*(0.15*pi)), _centery+28*sin(i*(0.15*pi)));
}

As you can guess, I'm lacking math skills.

  • I'm surprised you've already gotten so far, you might need to just reverse one or two values to get the desired result. Perhaps a form of drawing tool or a seperate empty game environment could help if the compile times takes too long. – Steven Jun 22 '23 at 06:48
  • @Steven You were right. I only had to use sin incrementation on x and cos on y, swapping the functions around. Thanks! – Misticloud Jun 22 '23 at 11:30
  • No problem, I'm glad to hear it worked out! :) – Steven Jun 22 '23 at 12:32

1 Answers1

0

Using sin for x incrementation and cos for y swaps the axis of the drawing circle, resulting in the style I wanted.

Like this:

//Mana UI
for (var i=0; i<5; i++)
{
    draw_sprite(spr_mana_orb, 0, _centerx+28*sin(i*(0.15*pi)), _centery+28*cos(i*(0.15*pi)));
}