[Finish]Mouse pointer not moving

Just starting out? Need help? Post your questions and find answers here.
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

[Finish]Mouse pointer not moving

Post by SPH »

Why Mouse pointer not moving ??

Code: Select all

InitSprite()
InitKeyboard()
InitMouse()

OpenWindow(0,0,0,500,100,"SPH_Entertainment",#PB_Window_ScreenCentered);|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,500,100,1,0,0)

CreateSprite(0,40,40)
StartDrawing(SpriteOutput(0))
LineXY(0,0,30,20,RGB(255,255,0))
LineXY(20,30,30,20,RGB(255,255,0))
LineXY(20,30,0,0,RGB(255,255,0))
StopDrawing()


Repeat
  Repeat         ;- Gestion de la fenêtre
    Event  = WindowEvent() 
  Until Event = 0
  
  ;;;;;
  
  ExamineMouse()
  x=MouseX()
  y=MouseY()
  Debug Str(x)+" : "+Str(y)
  Delay(5)
  
  DisplayTransparentSprite(0,x,y)
  
  ;;;;;
  
  ExamineKeyboard()
  
Until KeyboardPushed(#PB_Key_Escape)
Last edited by SPH on Tue Jul 08, 2025 3:14 pm, edited 1 time in total.

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
STARGÅTE
Addict
Addict
Posts: 2226
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Mouse pointer not moving

Post by STARGÅTE »

ExamineMouse()
In fullscreen mode the command FlipBuffers() need to be called inside your event loop to handle all events properly.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

Re: Mouse pointer not moving

Post by SPH »

... Flipbuffer() !!!

sorry

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
miso
Enthusiast
Enthusiast
Posts: 406
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [Finish]Mouse pointer not moving

Post by miso »

For 6.21 sprites:

Code: Select all

InitSprite()
InitKeyboard()
InitMouse()

OpenWindow(0,0,0,500,100,"SPH_Entertainment",#PB_Window_ScreenCentered);|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,500,100,1,0,0)

CreateSprite(0,40,40,#PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(0))
  DrawingMode(#PB_2DDrawing_AllChannels)
  Box(0,0,OutputWidth(),OutputHeight(),RGBA(0,0,0,0))
  LineXY(0,0,30,20,RGBA(255,255,0,255))
  LineXY(20,30,30,20,RGBA(255,255,0,255))
  LineXY(20,30,0,0,RGBA(255,255,0,255))
StopDrawing()


Repeat
  Repeat         ;- Gestion de la fenêtre
    Event  = WindowEvent() 
  Until Event = 0
  ExamineKeyboard()
  ExamineMouse()
  ClearScreen(RGB(60,20,20))
 
  x=MouseX()
  y=MouseY()
 
  DisplayTransparentSprite(0,x,y)
  FlipBuffers()
  Delay(1)
Until KeyboardPushed(#PB_Key_Escape)
Post Reply