PDA

View Full Version : Change the Width and height of a rectangle



Ahmad Shadeed
06-21-2012, 01:29 AM
Good Morning/Evening :)

I have a question, if I want to change the width of a rectangle by using keyboard keys,

for example , if i pressed the left arrow key, then the rectangle width increased to the left side, and if i do the same for right arrow key,

then the rectangle width increased to the right side

and so on for up and down keys..

I need your help plz

Thanks

Trek800
06-21-2012, 01:46 PM
I'm not sure if this is the "correct" way but to do what you want you could create the rectangle using variables as the specifications for the vertices and then use the keys to change the values of these variables.

Ahmad Shadeed
06-21-2012, 01:55 PM
I'm not sure if this is the "correct" way but to do what you want you could create the rectangle using variables as the specifications for the vertices and then use the keys to change the values of these variables.

I Know what you say! but I want the code :(

Trek800
06-21-2012, 03:49 PM
I Know what you say! but I want the code :(

If you know how to do it, then you should do it yourself. You will learn better and most people won't take the time to go and type out the code for you