Euflorium: The Eufloria Community
Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: annikk.exe on June 01, 2011, 11:08:51 PM
-
Can anyone explain to me how DrawBox() is used? What variables do I use with it, etc ?
-
Simple: DrawBox(id,fade,x1,y1,x2,y2,r,b,g,a)
Id is the texture I belive, haven't tested...
Fade is... fade? It talks for itslef hopelyfully...
X1,Y1,X2,Y2 is the points from a side,top,another side, bottom. Use theese four points to draw the box.
r,b,g,a is Red, Blue, Green, Alpha
Alpha is how visible the box is overall, so zero is an invisible box and one is a totally visible one that blocks every other sights. Now ofcourse you can have 0.3 or 0.7 or any number between 0 and 1(this rule also comes to r,b,g!)
EDIT: Note that it's impossible to draw it in any angle, it's stay vertical/horizontal what so ever!
-
I'm a bit confused about how the coordinates are used.
X1, Y1... are these coordinates of one corner of the box, or are they the lengths of sides?
-
Cordinates of each corner...
-
Ah wait, I've figured it out now, after some brief experimentation. :>
It's NOT the coordinates of the corners though! The corner is a point, which has 2 coordinates; X, and Y. So to record the box by its corners you would need 8 values instead of 4.
Instead, X1 refers to "how far to the left shall the left hand side of the box extend?"
X2 refers to "how far to the right shall the right hand side of the box extend?"
Y1 and Y2 are how far up and down the top and bottom of the square should extend.
Rather clever really. :> Although it does mean you sacrifice the ability to rotate the square.
-
I've used DrawBox alot, and I can remember that X1 is the left side and Y1 is how far up and X2 is how far right and Y2 is how far down, so:
Think it as drwing a line, replace drawbox with drawline and you see it, you jsut need 4 values fot eh coordination :)
(the line becomes the diagonal of the square/box)
-
It is kinda the co-ords of points -- the top-left and bottom-right ones. Think of the box as a rectangle that has the line (x1,y1)-->(x2,y2) of one of its diagonals
-
It's the same way as drawing a line from point a to b, just adding a triangle on both sides.
Imagine pythagoras, where you need to draw new lines to find the distance², well, there the lines become visibloe and are the boundaries for the fill :)
-
Yes I see what you mean now. Hmm, either interpretation can be correct, I suppose. :>
-
A DrawPoly() would be useful here... arguments are the co-ords of the points.
-
How do you use DrawPoly()? What are the arguments?
-
I think he's saying "DrawPoly() would be useful", as in, it would be nice if that command actually existed..
-
Hold on, I've nearly finished making it.
-
Hah
Nice :>
Can it be n-sided? :>
-
Yup.
http://www.dyson-game.com/smf/index.php?topic=1359.0