beginner's questions
Re: beginner's questions
I have 2 questions to skilled FB programmers:
1. How can I hide the mouse cursor without deactivating it? The SetMouse is not good for me, because it although hide, but deactivate the mouse. Or is there a possibility to change the mouse cursor to other sprite?
2. Is there a possibility in FB to scaling the graphics sprites? Can I resize those in the program? And how?
I tried D.J. Peters' demo from here: viewtopic.php?t=15819
it works well, but is there no built-in FB commands for this?
1. How can I hide the mouse cursor without deactivating it? The SetMouse is not good for me, because it although hide, but deactivate the mouse. Or is there a possibility to change the mouse cursor to other sprite?
2. Is there a possibility in FB to scaling the graphics sprites? Can I resize those in the program? And how?
I tried D.J. Peters' demo from here: viewtopic.php?t=15819
it works well, but is there no built-in FB commands for this?
Re: beginner's questions
Hi ITomi,
The mouse is not desactivated. In the snippet below (just the example setmouse changed a bit), the mouse is not visible and still active.ITomi wrote:I have 2 questions to skilled FB programmers:
1. How can I hide the mouse cursor without deactivating it? The SetMouse is not good for me, because it although hide, but deactivate the mouse. Or is there a possibility to change the mouse cursor to other sprite?
Just set the mouse invisible and draw your sprite (instead circle as in the example) at the mouse coordinnates.ITomi wrote: is there a possibility to change the mouse cursor to other sprite?
No there is not. But the DJP's tool is fine or write your own :-)ITomi wrote:it works well, but is there no built-in FB commands for this?
Code: Select all
Dim As Integer x, y, buttons
' create a screen 640*480
ScreenRes 640, 480
Print "Click the mouse button to center the mouse"
SetMouse 320, 240,0
Do
' get mouse x, y and button state (wait until mouse is onscreen)
Do: Sleep 1:
GetMouse( x, y , , buttons)
circle(x,y),5,15
If buttons<>0 Then Exit Do
Loop Until 0
If buttons And 1 Then
' on left mouse click, center mouse
SetMouse 320, 240
End If
' run loop until a key is pressed or the window is closed
Loop While Inkey = ""
Last edited by SARG on Jul 20, 2018 13:28, edited 1 time in total.
Re: beginner's questions
ITomi wrote:I have 2 questions to skilled FB programmers:
1. How can I hide the mouse cursor without deactivating it? The SetMouse is not good for me, because it although hide, but deactivate the mouse. Or is there a possibility to change the mouse cursor to other sprite?
Code: Select all
#include "fbgfx.bi"
Type mouse
As Integer res
As Integer x, y, wheel, clip
Union
buttons As Integer
Type
Left:1 As Integer
Right:1 As Integer
middle:1 As Integer
End Type
End Union
End Type
Screenres 800, 600, 32
Setmouse , , 0
Dim As mouse m
Do
m.res = GetMouse( m.x, m.y, m.wheel, m.buttons, m.clip )
ScreenLock
'Cls
Circle (m.x, m.y), 5, &h004488AA
locate 1,1
Print Using "res = #"; m.res
Print Using "x = ###; y = ###; wheel = +###; clip = ##"; m.x; m.y; m.wheel; m.clip
Print Using "buttons = ##; left = #; middle = #; right = #"; m.buttons; m.left; m.middle; m.right
ScreenUnlock
Sleep 11, 1
Loop While Inkey = ""
Last edited by badidea on Jul 21, 2018 8:09, edited 1 time in total.
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: beginner's questions
Why do the stats say that ron joined Jun 02 2006 if he has just joined?ron wrote:Hi I've just heard of FreeBASIC for the first time.
Re: beginner's questions
@basiccoder:
The thread was "bumped" by Itomi.
It was originally started by ron in 2006, and then Itomi posted here in 2018.
I don't know why he didn't start his own thread but he got answered and thats all that counts.
The thread was "bumped" by Itomi.
It was originally started by ron in 2006, and then Itomi posted here in 2018.
I don't know why he didn't start his own thread but he got answered and thats all that counts.
Re: beginner's questions
Moreover ron did not fizzle on the forum: only 4 days!
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: beginner's questions
Now I just feel silly for not noticing that. Can we delete all the posts backs to my last one?sancho3 wrote:@basiccoder:
The thread was "bumped" by Itomi.
Re: beginner's questions
Sorry, I just thought I don't open a new topic because of my two questions if already exist a topic with similar title. I thought, it is a good idea to put these into one instead of open a new topic, as I'm also a beginner.
Sorry once more... :-(
Sorry once more... :-(
Re: beginner's questions
No problem, I think.
Issue 2 (scaling): No built-in command as far as I know.
Issue 2 (scaling): No built-in command as far as I know.
Re: beginner's questions
Perhaps ron did a sancho2
Re: beginner's questions
@Dodicat, Lol, it could be.