ResizeScreen
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
ResizeScreen
Hello,
I have a little wish, again.
A ResizeScreen-Function for OpenWindowedScreen would be very helpful.
I believe, that wouldn't be a problem. 'Cause you only would have to change the buffer- and clientarea-size.
Best regards
Wolf
I have a little wish, again.
A ResizeScreen-Function for OpenWindowedScreen would be very helpful.
I believe, that wouldn't be a problem. 'Cause you only would have to change the buffer- and clientarea-size.
Best regards
Wolf
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
As a workaround you can always put the windowedscreen() in a containergadget and then just resize the gadget.
Just open the screen/gadget combo to the biggest size you will need to start with.
Just open the screen/gadget combo to the biggest size you will need to start with.
Code: Select all
InitSprite()
OpenWindow(0,0,0,800,600,"",$ca0001)
CreateGadgetList(WindowID(0))
ContainerGadget(1,0,0,600,600)
OpenWindowedScreen(GadgetID(1),0,0,600,600,0,0,0)
CloseGadgetList()
ButtonGadget(2,650,300,100,20,"Click to resize")
CreateSprite(2,40,40)
StartDrawing(SpriteOutput(2))
Box(0,0,40,40,0)
StopDrawing()
x=100
y=100
xd=-1
yd=-1
maxx=560
maxy=560
Repeat
ClearScreen(#White)
DisplaySprite(2,x,y)
FlipBuffers()
x+xd
y+yd
If x=0 Or x=maxx
xd=-xd
EndIf
If y=0 Or y=maxy
yd=-yd
EndIf
e=WindowEvent()
If e=#PB_Event_Gadget
gad=EventGadget()
If gad=2
x=100
y=100
maxx=400
maxy=400
ResizeGadget(1,0,0,440,440)
EndIf
EndIf
Until e=#PB_Event_CloseWindow
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
I also think it's a appropriate workaround.
you always would have to keep track of the actual size after resizing,
store the actual size in variables to adjust your display according to it.
it's not that a big difference to do that with a risizing container instead of a resizing screen...
you always would have to keep track of the actual size after resizing,
store the actual size in variables to adjust your display according to it.
it's not that a big difference to do that with a risizing container instead of a resizing screen...
oh... and have a nice day.
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
If you had a windowscreen of 1024*768 and you change the resolution of the desktop to 1280*800 then you would have to change the size of your window anyway as it would not automatically change so what is the difference in using a containergadget set to 1024*768 to startwith and opening a screen of 1280*800 in it.
Anyway, you are right it is not the idea solution.
Anyway, you are right it is not the idea solution.
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
even if this wish is already old, i have to total agree. closing and reopening a windowed screen, is just a waste of performance. a real ResizeWindowedScreen() function, without the need for reloading the sprites again, would be very awesome.
c ya,
nco2k

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf