I don't see any meaningful executable code here that represents the features you describe.
Where is the rest of the code?
Mouse with Mouse Pointer Coordinates
Re: Mouse with Mouse Pointer Coordinates
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Mouse with Mouse Pointer Coordinates
This was not an attack, just a serious question ....Are you all like this? Don't you read the posts? Are you all so agressive?
to understand this kind of tip or trick, a running example is needed.
My personal opinion is that querying variables is one of the absolute basics of a programming language.
Therefore, I cannot identify this "trick" as such... sorry.
Moreover, your suggested usage is quite violent ! To get mouse coordinates that make sense, you have to
run your code inside a loop... and already we have a problem, because a Font is loaded continuously...
the hard disk is not standing still, the execution can be very slow (if the user do not have a ssd) and the
memory is running out
And by the way, no one will look at something like this if they have to build a program around it first,
just to see what this code does... An executable example simply belongs to it...
Beginners who don't really have a clue about programming run the risk of getting used to bad and/or wrong
things. This is the reason why mk-soft (and actually everybody else) asks for the rest of the code...
Re: Mouse with Mouse Pointer Coordinates
Here is an executable example of Lord Santos codes without the continuously loading of fonts:
Code: Select all
Enumeration Window
#Window
EndEnumeration
Enumeration Sprite
#Sprite_Cursor
EndEnumeration
Enumeration Font
#Font_Cursor
EndEnumeration
InitSprite()
InitMouse()
InitKeyboard()
OpenWindow(#Window, 0, 0, 960, 540, "Mouse with Mouse Pointer Coordinates", #PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window))
LoadFont(#Font_Cursor, "Arial", 10)
CreateSprite(#Sprite_Cursor, 48, 48)
Repeat
Repeat
Select WindowEvent()
Case #PB_Event_None
Break
Case #PB_Event_CloseWindow
Break 2
EndSelect
ForEver
ExamineMouse()
If StartDrawing(SpriteOutput(#Sprite_Cursor))
DrawingFont(FontID(#Font_Cursor))
LineXY(0,0,20,10)
LineXY(0,0,10,20)
DrawText(0, 24, LSet(Str(MouseX())+"-"+Str(MouseY()), 11))
StopDrawing()
EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_All)
Break
EndIf
ClearScreen($000000)
DisplayTransparentSprite(#Sprite_Cursor, MouseX(), MouseY())
FlipBuffers()
ForEver
End
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module