2
0
woollybah 6 жил өмнө
parent
commit
97ce84b738

+ 15 - 0
sdltimer.mod/sdltimer.bmx

@@ -86,12 +86,23 @@ End Function
 
 
 Public
 Public
 
 
+Rem
+bbdoc: An SDL implementation of a #TTimer.
+End Rem
 Type TSDLTimer Extends TTimer
 Type TSDLTimer Extends TTimer
 
 
+	Rem
+	bbdoc: Gets timer tick counter.
+	returns: The number of times the timer has ticked over
+	End Rem
 	Method Ticks:Int()
 	Method Ticks:Int()
 		Return _ticks
 		Return _ticks
 	End Method
 	End Method
 	
 	
+	Rem
+	bbdoc: Stops the timer
+	about: Once stopped, the timer can no longer be used.
+	End Rem
 	Method Stop()
 	Method Stop()
 		If Not _handle Return
 		If Not _handle Return
 		bmx_sdl_timer_stop _handle,Self
 		bmx_sdl_timer_stop _handle,Self
@@ -109,6 +120,10 @@ Type TSDLTimer Extends TTimer
 		EndIf
 		EndIf
 	End Method
 	End Method
 
 
+	Rem
+	bbdoc: Waits until the timer ticks.
+	returns: The number of ticks since the last call to #Wait.
+	End Rem
 	Method Wait:Int()
 	Method Wait:Int()
 		If Not _handle Return 0
 		If Not _handle Return 0
 		Local n:Int
 		Local n:Int

+ 19 - 1
virtualjoystick.mod/virtualjoystick.bmx

@@ -219,7 +219,7 @@ Type TVirtualJoystick
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
-	bbdoc: 
+	bbdoc: Creates a new virtual joystick instance, using the specified configuration.
 	End Rem
 	End Rem
 	Method Create:TVirtualJoystick(name:String, x:Int, y:Int, stickRadius:Int, knobRadius:Int, flags:Int = VS_AXIS_XY)
 	Method Create:TVirtualJoystick(name:String, x:Int, y:Int, stickRadius:Int, knobRadius:Int, flags:Int = VS_AXIS_XY)
 		Self.name = name
 		Self.name = name
@@ -240,6 +240,7 @@ Type TVirtualJoystick
 	
 	
 	Rem
 	Rem
 	bbdoc: Adds a button at the specified location.
 	bbdoc: Adds a button at the specified location.
+	returns: The button id.
 	End Rem
 	End Rem
 	Method AddButton:Int(x:Int, y:Int, radius:Int)
 	Method AddButton:Int(x:Int, y:Int, radius:Int)
 		Local id:Int = buttons.length
 		Local id:Int = buttons.length
@@ -329,24 +330,41 @@ Type TVirtualJoystick
 		End Select
 		End Select
 	End Method
 	End Method
 	
 	
+	Rem
+	bbdoc: Reports the horizontal position of the joystick.
+	returns: Zero if the joystick is centered, -1 if Left, 1 if Right or a value in between.
+	End Rem
 	Method GetX:Float()
 	Method GetX:Float()
 		If flags & VS_AXIS_X Then
 		If flags & VS_AXIS_X Then
 			Return Float(xPos - centerX) / radius
 			Return Float(xPos - centerX) / radius
 		End If
 		End If
 	End Method
 	End Method
 	
 	
+	Rem
+	bbdoc: Reports the vertical position of the joystick.
+	returns: Zero if the joystick is centered, -1.0 if Up, 1.0 if Down or a value in between.
+	End Rem
 	Method GetY:Float()
 	Method GetY:Float()
 		If flags & VS_AXIS_Y Then
 		If flags & VS_AXIS_Y Then
 			Return Float(yPos - centerY) / radius
 			Return Float(yPos - centerY) / radius
 		End If
 		End If
 	End Method
 	End Method
 	
 	
+	Rem
+	bbdoc: Test the status of a joystick button.
+	returns: #True if the button is pressed.
+	End Rem
 	Method ButtonDown:Int(button:Int)
 	Method ButtonDown:Int(button:Int)
 		If button < buttons.length Then
 		If button < buttons.length Then
 			Return buttons[button].down
 			Return buttons[button].down
 		End If
 		End If
 	End Method
 	End Method
 	
 	
+	Rem
+	bbdoc: Checks for a joystick button press.
+	returns: Number of times @button has been hit.
+	about: The returned value represents the number of the times @button has been hit since the last call to #ButtonHit with the same specified @button.
+	End Rem
 	Method ButtonHit:Int(button:Int)
 	Method ButtonHit:Int(button:Int)
 		If button < buttons.length Then
 		If button < buttons.length Then
 			Return buttons[button].Hit()
 			Return buttons[button].Hit()