2 Questions about Drawing

Scepterus

  • Posts: 16
Hey, I'm in the process of creating a game, and i want a few things with the draw feature that I did not find the answer to.

1. is there a way to smooth the edges of a draw? I'm drawing a curved rectangle, and it looks very sharp against my graphics.

2. is there a way to draw text on top of a shape draw? i want to draw an attribute on the rectangle from the first question.

thanks

greatanthony

  • Posts: 168
hi,

1)    a) try increasing stroke thickness.....
         ====between 2 and 5 is a good value ( you may experiment to suit your own needs)



        b) experiment with the [arc]  .........
            less 45 and 10 and above is the considerable range........







2)  for drawing text, keep the block of drawing always below the rectangle drawing blocks :
     
     
       i've setted the color of font to white in the FONT editor........

OUTPUT :


 

« Last Edit: March 22, 2017, 01:15:34 am by greatanthony »

Scepterus

  • Posts: 16
thanks for the reply,  the second one really helps, Thanks!

as for the first one, the arc is 15 and border thickness is 2, and it still looks sharp.
i've attached a screenshot.

greatanthony

  • Posts: 168
hi,  it was not that sharp as I expected  :)...........

-You should try on experimenting with changing the values of arc.......as it has no loss.........

-However if you have less time for that, and you want perfect of perfect rounded rectangle, then you may draw yourself one in an image editor ( inkscape,illustrator,gimp,etc.).and then simply use them as image instance...........that would be less time consuming....

« Last Edit: March 24, 2017, 04:09:17 am by greatanthony »

Scepterus

  • Posts: 16
problem is, it's a health bar, that drains and fills, it has to be a draw.
guess i'll just pad it more with a thicker border.


TheIndieStation

  • *
  • Posts: 2263
You are looking for an anti alias option fr draw commands. But im not sure we have that yet

Scepterus

  • Posts: 16
not in the latest version, no.

squeeb

  • Posts: 1597
liberado made a health bar with image api...
http://community.stencyl.com/index.php/topic,50086.msg277066.html#msg277066
i used it to make a mic detection in flash.. maybe itll help with what you're trying to accomplish
<a href="http://static.stencyl.com/games/36244-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/36244-0.swf</a>


CmdrWhitey13

  • Posts: 503
The health bar doesn't have to be a draw.
If image instance, you may want to use a get/set width for image instance.

Hope it helps.

Scepterus

  • Posts: 16
well i want the health bar to have 3 different colors depending on the HP attribute, full is green towards the middle is yellow and when almost dying red.

what he did with the api, is make an image with all three colors, i want to bar to be 1 solid color at each stage.

greatanthony

  • Posts: 168
hi again  :) ,

Create [health] as a number attribute ( you should have already created that!)

and a color attribute [health color] .......


define it's starting value :



DRAWING :


ALWAYS :


------- you would adjust the width( here 200) and height( here 25) as your needs........

note : whatever or however the health is decreased ( by get hit by bullet,etc) then you have to also decrement this [health] attribute also.....
LIKE :



wish it helps you.........


« Last Edit: March 25, 2017, 10:30:05 pm by greatanthony »

Scepterus

  • Posts: 16
hi again  :) ,

Create [health] as a number attribute ( you should have already created that!)

and a color attribute [health color] .......


define it's starting value :



DRAWING :


ALWAYS :


------- you would adjust the width( here 200) and height( here 25) as your needs........

note : whatever or however the health is decreased ( by get hit by bullet,etc) then you have to also decrement this [health] attribute also.....
LIKE :



wish it helps you.........



hey, i'm sorry i wasn't clear, i already have that system in place, this is why i want to use draw.
and as for the damage, it's a calculation of defense and the attacker's offense, or ATK attribute.

if it's not clear yet, i made a JRPG replica in stencyl, something i've read was impossible according to the forum, but it's working and now i only polish some aspects like the draw.

thanks for wanting to help by showing me the stages of code, p.s. the when created is not necessary as the color can change in the drawing, which makes the Always not necessary as well, the both work on a frame by frame, so i just put the color change if's in the draw.