
-----------------------------------
MihaiG
Sun Feb 27, 2005 7:51 pm

Felxible array-polygon
-----------------------------------
is posible to implement flexible arrays in the drawfillpolygon as in if ur using mosuemove....and you want a polygon to follow the mouse how do u do that...it doesn't seem to work :? thnx for any suggestions

-----------------------------------
Bacchus
Sun Feb 27, 2005 8:01 pm


-----------------------------------
... ok... what? im guessing: you want a polygon to follow the mouse as you move and you want to store the polygon in a flexible array?
wait just thought of something. kinda like lasso tool in photoshop so when you click it adds a new points to the polygon? would be good for a paint program and such and other uses, try it i dont kno lol

-----------------------------------
AsianSensation
Sun Feb 27, 2005 9:25 pm


-----------------------------------
I'm pretty sure you can use flexible arrays with drawfillpolygon

var x : flexible array 1 .. 1 of int
var y : flexible array 1 .. 1 of int
var mx, my, btnNumber, btnUpDown : int

loop
    Mouse.ButtonWait ("down", mx, my, btnNumber, btnUpDown)
    new x, upper (x) + 1
    x (upper (x)) := mx
    new y, upper (y) + 1
    y (upper (y)) := my

    drawfillpolygon (x, y, upper (x), 7)
end loop

-----------------------------------
jamonathin
Sun Feb 27, 2005 9:37 pm


-----------------------------------
i know this may not have too, too much to deal with the topic, but i was tryin to understand the drawfillpolygon, and so i put a cls right before it draws (in asiansensation's prog.) and it juss kinda makes it look cooler, not erase.  :?

-----------------------------------
MihaiG
Mon Feb 28, 2005 8:50 pm


-----------------------------------
i reall meant something like this ...but thate preatt cool 2(thnx AsianSen


View.Set ("offscreenonly")
var x, y, b : int
loop
    cls
    mousewhere (x, y, b)
    Draw.FillOval (x, y, 10, 10, 7)
    View.Update
end loop

but instead of oval...o multi-sided polygon..i need an example tutorial can't help me

-----------------------------------
MihaiG
Wed Mar 02, 2005 8:38 pm


-----------------------------------
well thnx to those who gave help i finnaly figured it out with some help :roll: 

heres what i meant

setscreen ("graphics:max;max")
View.Set ("offscreenonly")
var x : array 1 .. 4 of int := init (500, 520, 10, 10)
var y : array 1 .. 4 of int := init (0, 0, 10, 10)

var mousex, mousey, b : int
loop
    cls
    mousewhere (mousex, mousey, b)
    x (3) := mousex + 10
    x (4) := mousex - 10
    y (3) := mousey + 24
    y (4) := mousey - 87
    x (1) := mousex + 10
    x (2) := mousex - 10
    y (1) := mousey + 34
    y (2) := mousey - 45
    Draw.FillPolygon (x, y, upper (x), 7)
    View.Update
end loop


something like this 

thnx :-)i shall now concur the world! muwuhhhaah
 :twisted:  :twisted:  :twisted:

-----------------------------------
Bacchus
Wed Mar 02, 2005 9:20 pm


-----------------------------------
lol that has nothing to do with flexible arrays

-----------------------------------
Flikerator
Wed Mar 02, 2005 9:35 pm


-----------------------------------
I know, it doesnt even use a flexible array! Im sorry but thats funny :P
