It seems that the auto-resizing of the screen has a bug.
IT work if the window and the screen have the same size, but it doesn't work if the screen and the window haven't the same size.
The mouse should be captured inside the side zoomed of the screen, and it seems the mouse is captured inside the original size of the screen.
Code: Select all
;{ init
If InitSprite() <> 0 : EndIf
If InitKeyboard() <> 0 : EndIf
If InitMouse() <> 0 : EndIf
;}
flag = #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget
If OpenWindow(0,0,0,1200,800, "Game, screen Autoresized", Flag) <> 0
If OpenWindowedScreen(WindowID(0), 0,0,600,400,1,0,0) <> 0
ScreenW = ScreenWidth()
ScreenH = ScreenHeight()
WinW = WindowWidth(0)
WinH = WindowHeight(0)
EndIf
ShowCursor_(1)
EndIf
Repeat
Repeat
EventID = WaitWindowEvent(1)
Select EventID
Case #PB_Event_CloseWindow
End
EndSelect
Until event = 0
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
EndIf
RatioX = WindowMouseX(0) / (WinW/ScreenW)
RatioY = WindowMouseY(0) / (WinH/ScreenH)
If ExamineMouse()
mx = MouseX()
my = MouseY()
If MouseButton(#PB_MouseButton_Left)
clic = 1
Else
clic = 0
EndIf
EndIf
If StartDrawing(ScreenOutput())
u=0
DrawText(0,0,"Try to go over "+Str(ScreenW)+" x "+Str(ScreenH)) : u+20
DrawText(0,u,Str(mx)+"/"+Str(my)) : u+20
; DrawText(0,u,Str(RatioX)+"/"+Str(RatioY)) : u+20
DrawText(0,u,Str(WindowMouseX(0))+"/"+Str(WindowMouseY(0))) : u+20
DrawText(0,u,"Clic : "+Str(clic))
StopDrawing()
EndIf
FlipBuffers()
ClearScreen(RGB(200,200,200))
ForEver
FR (pour Fred

Il semblerait qu'il y ait un soucis si on utilise l'option RedimensionnementAuto lors de la création de l'écran.
Lorsqu'on agrandit l'écran avec l'option Redimensionnementauto (très utile pour la création de jeu
