x,y,width,height - New gadget shape
Description:SetGadgetShape allows you to change the position and size of a gadget.
NB. only use SetGadgetShape on a canvas if you don't mind the distortion/stretching of the actual canvas pixels.
See also: GadgetX, GadgetY, GadgetWidth, GadgetHeight, SetGadgetLayout, SetGadgetFont, SetGadgetText.
; Create a window, and button
win = CreateWindow("Play The Click Me Game",100,100,200,200,0,57)
button = CreateButton("Click Me!",50,50,100,100,win)
; Set everything up to start our little game
SetStatusText win,"Click the button to start the game!"
clicks = 0
; A small event loop
; Wait for events
id = WaitEvent()
; Exit on window close
Case $803 : Exit
; Button clicked
; move the button
; update game information
If clicks=0 Then time = MilliSecs()
clicks = clicks + 1
SetStatusText win, clicks + " clicks in " + (MilliSecs()-time)/1000.0 + " seconds"
End ; bye!
| Strange visual effects will occur if w,h are changed on a canvas gadget, use freegadget, creatgadget instead to resize a canvas |
|Stamm||(Posted 1+ years ago)|
| What about simply flipping the canvas afterwards? |
| Nope, canvas updates will be squashed or stretch too. The Freegadget approach causes a lot of screen flicker as the window/canvas is resized. The correct approach is to make the canvas the maximum size needed or possible (due to screen resolution) on start-up, lock the top and right edges and then only change x,y due to a resize event and only if x or y is non zero. |
BlitzPlus Manual Forum
Blitz3D Equivalent Command