Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Few questions about DrawLine

Author
Message
Mandemon
8
Years of Service
User Offline
Joined: 1st Jan 2016
Location: Finland
Posted: 20th Jan 2016 22:06
Okay, so, I was thinking of making a small simulation with plants and rather than try to mess with sprites, I would use in-build draw functions. However, I could not find answer for this questions.

For the function DrawLine, is there anyway to set the width of the line, or is it always 1 pixel wide?

In short, let's say I want to draw a line that is 3 pixels wide, from coordinates 50,45 to 60,50. Can I somehow specify that the line needs to be 3 pixels wide, or do I need to draw 3 lines, one that goes straight from 50,45 -> 60, 50, one that goes 51,45 -> 61,45 and last one 49,45 -> 59,50?

Also, this was slightly unclear too, do I need to draw the line with each cycle, or can I draw it just once and it will stay on screen until I order its deletion.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Jan 2016 22:20 Edited at: 20th Jan 2016 22:21
You have to draw multiple lines and you also have to draw once every sync. If you use sprites AppGameKit will draw all sprites for you each sync, which is faster than doing so manually. You could use blank sprites which use a single color and no image. These you can set to any size and rotate. Those are super fast for the engine to draw as well.

http://www.appgamekit.com/documentation/Reference/Sprite/CreateSprite.htm
Mandemon
8
Years of Service
User Offline
Joined: 1st Jan 2016
Location: Finland
Posted: 20th Jan 2016 22:48
Yeah, that was what I first thought. Just draw a white 1x1 pixel sprite, rotate it and then scale it to proper size. I had hoped I could do it without having to mess with sprites and calculate their positions during the creation, but oh well.

Login to post a reply

Server time is: 2024-11-17 02:56:12
Your offset time is: 2024-11-17 02:56:12