Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / window.draw_line() help
- - By JhoabMendez Date 2012-08-21 19:29
I'm starting now in Gosu Library and want know if  have the possibility of make a dashed line with window.draw_line(). If not, as I can create that?

Valeu!
Parent - - By Spooner Date 2012-08-21 23:42
draw_line just does regular straight lines (it just wraps the OpenGL line drawing system, GL_LINE, I think). If you want a dashed line, then you could, perhaps, use many small draw_lines instead.
Parent - - By JhoabMendez Date 2012-08-22 18:06
I wanted a dashed line of a fixed point to the coordinates of Mouse, in the case,
the line will be moving. But thank you. I'm thinking in a resolution. :)
example
Parent - - By lol_o2 Date 2012-08-22 18:24
Try using offset_x and offset_y.
First, use angle method to calculate angle from 'fixed point' to mouse, then draw multiple short lines in that direction. For number of needed short lines, you can use distance method and divide it.
Parent - By JhoabMendez Date 2012-08-23 19:06
Well, I thought in something similar to that.
But I'm using a better idea in this part of game.
Thanks for attention.
:)
Up Topic Gosu / Gosu Exchange / window.draw_line() help

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill