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 / Drawline size with drawbox

Author
Message
Hubert BAYRE
6
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 21st Feb 2018 20:24
Hello.
I want increase the drawline size (more than 1 px). So ... DrawMyline (x1,y1,x2,y2,size)
I've you already some code to show how to write a function using a rotating drawbox.
Many thanks.
puzzler2018
User Banned
Posted: 21st Feb 2018 20:26
You mean like Stroke in C?
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Feb 2018 20:50 Edited at: 23rd Feb 2018 17:51
Well, you can't rotate the box command, but you can rotate and stretch a sprite.

Typed this up at work, so I haven't tested it. In theory this should work. Create a blank sprite and resize it to match the desired line. If the line appears to point in the wrong direction, the angle in the last command could be off. If it is, I'd guess it's either off by 90 or 180 degrees (easily figure out by running the app and looking at how it's positioned on screen). Just add the correct amount to the calculated angle to fix this (if it happens).

Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
puzzler2018
User Banned
Posted: 21st Feb 2018 20:52
If so, then this is best I can up with





IronManhood
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location: US
Posted: 22nd Feb 2018 01:57 Edited at: 22nd Feb 2018 04:34
Here's a function I wrote and tested. It works

Hubert BAYRE
6
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 22nd Feb 2018 18:34
Many thanks for your help. works fine here.

Attachments

Login to view attachments
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Feb 2018 17:52
Updated my code above, finally had a chance to run my own stuff lol. I had to subtract 90 degrees from the atanfull calculation, as I suspected I might have to do.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-03-29 01:20:58
Your offset time is: 2024-03-29 01:20:58