Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Felxible array-polygon
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MihaiG




PostPosted: Sun Feb 27, 2005 7:51 pm   Post subject: 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 Confused thnx for any suggestions
Sponsor
Sponsor
Sponsor
sponsor
Bacchus




PostPosted: Sun Feb 27, 2005 8:01 pm   Post subject: (No subject)

... 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




PostPosted: Sun Feb 27, 2005 9:25 pm   Post subject: (No subject)

I'm pretty sure you can use flexible arrays with drawfillpolygon

Turing:
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




PostPosted: Sun Feb 27, 2005 9:37 pm   Post subject: (No subject)

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. Confused
MihaiG




PostPosted: Mon Feb 28, 2005 8:50 pm   Post subject: (No subject)

i reall meant something like this ...but thate preatt cool 2(thnx AsianSen

code:

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




PostPosted: Wed Mar 02, 2005 8:38 pm   Post subject: (No subject)

well thnx to those who gave help i finnaly figured it out with some help Rolling Eyes

heres what i meant
code:

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 Smilei shall now concur the world! muwuhhhaah
Twisted Evil Twisted Evil Twisted Evil
Bacchus




PostPosted: Wed Mar 02, 2005 9:20 pm   Post subject: (No subject)

lol that has nothing to do with flexible arrays
Flikerator




PostPosted: Wed Mar 02, 2005 9:35 pm   Post subject: (No subject)

I know, it doesnt even use a flexible array! Im sorry but thats funny Razz
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: