Returns the smallest angle (in degrees) satisfying the arc cosine (inverse cosine) of the supplied argument.
Parameter Description:
number=float or integer representing a ratio of the "X" coordinate to the tangential displacement.
Command Description:
This command is used for translating X/Y coordinate values to angles. Remember that the computer screen uses an inverted y-axis (values get larger the further down the screen).
Example:
Graphics 640,480
-Repeat
-Cls
-; Determine the positions and the length of the hypotenuse
-x# = MouseX() ; displacement across the screen.
-y# = MouseY() ; displacement down the screen.
-r# = Sqr((x#*x#)+(y#*y#)) ; length of the hypotenuse.
+
+
+Blitz3D Docs
+
+
+
+
ACos# ( c# )
+
Parameters
+
+
+
+c = a number in the range -1 to +1.
+
+It is considered to be the cosine of an angle.
+
+
+
+
Description
+
+
+
+ACos( c ) is an angle which has cosine = c.
+It is in the range 0 to +180 degrees.
+
+; ACos example
+
+; NaN means "Not a Number", the numerical result is invalid.
+
+Const width = 640, height = 480
+
+Graphics width, height
+
+
+Local C#, AC# ; Cos and ACos
+
+Print " C ACos( C )"
+Print "=================="
+
+For n = -11 To 11
+
+C = n / 10.0
+AC = ACos( C )
+Print RSet(C, 6) + RSet( AC, 10)
+
+Next
+
+WaitKey() : End
+
+
+
-; Draw the axes
-Color 104,104,104
-Line x#,0,x#,y# ; draw a line from the top to the cursor.
-Line 0,y#,x#,y# ; draw a line from the left to the cursor.
-Locate x#+10,y#-10 : Write "X=" : Print x#
-Locate x#-10,y#+10 : Write "Y=" :Print y#
-
-; reset any drawing to the top right
-Origin 0,0
+Index
-; Draw the angled line
-Color 255,255,255
-Line 0,0,x#,y# ; draw a line from the top right corner of the screen to the cursor.
-theta# = ACos(x#/r#) ; the angle between the x axis and the y axis.
-Locate 60,10 : Write "Angle:" : Print theta
-
-; Draws an arc showing the angle.
-For degrees#=0 To theta#; Step though all the degrees in the angle
-; The next line calculates the X and Y coordinates of the point of the circle using the Sin and Cos
-; commands, and multiplies it by 50 (to get a larger radius, try and change it).
-cy=Sin(degrees#)*50
-cx=Cos(degrees#)*50
-Plot cx,cy ; Draw the current point on the circle.
-Next ; Give us another angle
-
-Flip
-; Use the ESCAPE key to quit
-Until KeyDown(1)
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ASin.htm b/_release/help/commands/2d_commands/ASin.htm
index 1660c79..2af93d6 100644
--- a/_release/help/commands/2d_commands/ASin.htm
+++ b/_release/help/commands/2d_commands/ASin.htm
@@ -1,38 +1,61 @@
-Command: ASin ASin (number) Definition:
Returns the smallest angle (in degrees) satisfying the arc sine (inverse sine) of the supplied argument.
Parameter Description:
number=float or integer representing a ratio of the "Y" coordinate to the tangential displacement.
Command Description:
This command is used for translating X/Y coordinate values to angles. Remember that the computer screen uses an inverted y-axis (values get larger the further down the screen).
Example:
Graphics 640,480
-Repeat
-Cls
-; Determine the positions and the length of the hypotenuse
-x# = MouseX() ; displacement across the screen.
-y# = MouseY() ; displacement down the screen.
-r# = Sqr((x#*x#)+(y#*y#)) ; length of the hypotenuse.
-; Draw the axes
-Color 104,104,104
-Line x#,0,x#,y# ; draw a line from the top to the cursor.
-Line 0,y#,x#,y# ; draw a line from the left to the cursor.
-Locate x#+10,y#-10 : Write "X=" : Print x#
-Locate x#-10,y#+10 : Write "Y=" :Print y#
-
-; reset any drawing to the top right
-Origin 0,0
+
+
+Blitz3D Docs
+
+
+
+
ASin# ( s# )
+
Parameters
+
+
+
+s = a number in the range -1 to +1
+
+It is considered to be the sine of an angle.
+
+
+
+
Description
+
+
+
+ASin( s ) is an angle which has sine = s.
+It is in the range -90 to +90 degrees.
+
+; ASin example
+
+; NaN means "Not a Number", the numerical result is invalid.
+
+Const width = 640, height = 480
+
+Graphics width, height
+
+
+Local S#, AS# ; Sin and ASin
+
+Print " S ASin( S )"
+Print "=================="
+
+For n = -11 To 11
+
+S = n / 10.0
+AS = ASin( S )
+Print RSet(S, 6) + RSet( AS, 10)
+
+Next
+
+WaitKey() : End
+
+
+
-; Draw the angled line
-Color 255,255,255
-Line 0,0,x#,y# ; draw a line from the top right corner of the screen to the cursor.
-theta# = ASin(y#/r#) ; the angle between the x axis and the y axis.
-Locate 60,10 : Write "Angle:" : Print theta
+Index
-; Draws an arc showing the angle.
-For degrees#=0 To theta#; Step though all the degrees in the angle
-; The next line calculates the X and Y coordinates of the point of the circle using the Sin and Cos
-; commands, and multiplies it by 50 (to get a larger radius, try and change it).
-cy=Sin(degrees#)*50
-cx=Cos(degrees#)*50
-Plot cx,cy ; Draw the current point on the circle.
-Next ; Give us another angle
-
-Flip
-; Use the ESCAPE key to quit
-Until KeyDown(1)
-End
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ATan.htm b/_release/help/commands/2d_commands/ATan.htm
index e272551..f5d688d 100644
--- a/_release/help/commands/2d_commands/ATan.htm
+++ b/_release/help/commands/2d_commands/ATan.htm
@@ -1,27 +1,77 @@
-Command: ATan ATan (float) Definition:
Returns the angle from the X axis to a point (y,x).
Parameter Description:
float = floating point value (degrees)
Command Description:
Aside from its basic trig usage, this nifty command will allow you to derive an angle based on the x and y speed of a travelling object. Also see ATan2.
-
+t = any number.
+
+It is considered to be the tangent of an angle.
+
+
+
+
Description
+
+
+
+ATan( t ) is an angle which has tangent = t.
+It is in the range -90 to +90 degrees.
+
+See also ATan2 for an extended version with 360 degree range.
+
+; ATan example
+
+Const width = 640, height = 480
+
+Graphics width, height
+
+
+Local T#, AT# ; Tan and ATan
+
+zero# = 0
+
+Print " T ATan( T )"
+Print "======================="
+
+; First, an extreme case...
+
+T# = 1 / zero ; +Infinity
+AT = ATan( T )
+Print RSet(T, 10) + RSet( AT, 11)
+
+; Now, back to normal usage...
+
+For n = -10 To 10
+
+T = Sgn( n ) * n * n
+AT = ATan( T )
+Print RSet(T, 10) + RSet( AT, 11)
+
+Next
+
+; Finally, another extreme case.
+
+T# = -1 / zero ; -Infinity
+AT = ATan( T )
+Print RSet(T, 10) + RSet( AT, 11)
+
+WaitKey() : End
+
+
+
-; Starting point for our travelling box
-x=0
-y=0
+Index
-; random speed values for travelling
-xSpeed#=Rand(5)
-ySpeed#=Rand(5)
-
-; repeat until the ESC or box travels off the screen
-While Not KeyHit(1) Or y > 480 Or x > 640
-Cls
-; Draw our box
-Rect x,y,10,10,1
-; increment the box location based on random speed
-x=x+xSpeed
-y=y+yspeed
-; print the angle of our box travel
-Text 0,0,ATan(yspeed/xspeed)
-Flip
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ATan2.htm b/_release/help/commands/2d_commands/ATan2.htm
index 6320870..ceb5bf3 100644
--- a/_release/help/commands/2d_commands/ATan2.htm
+++ b/_release/help/commands/2d_commands/ATan2.htm
@@ -1,29 +1,84 @@
-Command: ATan2 ATan2 (xvalue,yvalue) Definition:
Returns the angle from the X axis to a point (y,x).
Parameter Description:
(yvalue,xvalue)
Command Description:
Aside from its basic trig usage, this nifty command will allow you to derive an angle based on the x and y speed of a travelling object.
-
Example:
; Atan2 example
+
+
+Blitz3D Docs
+
+
+
+
ATan2# ( y#, x# )
+
Parameters
+
+
+
+y, x are any numbers.
+
+They are interpreted as corresponding to a point ( x, y ).
+
+
+
+
Description
+
+
+
+ATan2 gives the angle between the positive x-axis and a vector from the point (0,0) to the point (x,y).
+
+One common use is in 2d graphics. Suppose you have two objects and you want to aim the first at the second.
+
+ATan2( y2 - y1, x2 - x1 ) gives the proper orientation for object1.
+You can use this angle to select an appropriately rotated image.
+
+Notice the reverse order, ATan2( y, x ) rather than ATan2( x, y).
+ATan2( y, x ) is analogous to ATan( y / x), but covers 360 degrees.
+
+The angle satisfies: -180 < ATan2 <= +180
+
-; Set graphics w/double buffering
-Graphics 640,480,16,0
-SetBuffer BackBuffer()
+Index
-; Starting point for our travelling box
-x=0
-y=0
-
-; random speed values for travelling
-xSpeed=Rand(5)
-ySpeed=Rand(5)
-
-; repeat until the ESC or box travels off the screen
-While Not KeyHit(1) Or y > 480 Or x > 640
-Cls
-; Draw our box
-Rect x,y,10,10,1
-; increment the box location based on random speed
-x=x+xSpeed
-y=y+yspeed
-; print the angle of our box travel
-Text 0,0,ATan2(yspeed,xspeed)
-Flip
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Abs.htm b/_release/help/commands/2d_commands/Abs.htm
index ff7e94e..e1965d3 100644
--- a/_release/help/commands/2d_commands/Abs.htm
+++ b/_release/help/commands/2d_commands/Abs.htm
@@ -1,7 +1,41 @@
-Command: Abs Abs (number) Definition:
Returns the absolute (positive) value of a number.
Parameter Description:
number = any valid number or numeric variable
Command Description:
Use this command to return the absolute value of a number; meaning its positive value. A negative 3 would become a positive 3. If what you want is a number without a fraction (say, convert 3.1415 into 3) use the Int() command.
Example:
number=-3
+
+
+Blitz3D Docs
+
+
+
+
Abs (number)
+
Parameters
+
+
+
+number = any valid number or numeric variable
+
+
+
+
Description
+
+
+
+Use this command to return the absolute value of a number; meaning its positive value. A negative 3 would become a positive 3. If what you want is a number without a fraction (say, convert 3.1415 into 3) use the Int() command.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/AcceptTCPStream.htm b/_release/help/commands/2d_commands/AcceptTCPStream.htm
index 8c2bfa2..92f06c4 100644
--- a/_release/help/commands/2d_commands/AcceptTCPStream.htm
+++ b/_release/help/commands/2d_commands/AcceptTCPStream.htm
@@ -1,57 +1,91 @@
-Command: AcceptTCPStream AcceptTCPStream (serverhandle) Definition:
Accepts an incoming TCP/IP stream.
Parameter Description:
serverhandle = the server handle assigned when the server was created
Command Description:
Accepts an incoming TCP/IP stream, and returns a TCP/IP stream if one is available, or 0 if not.
+
+
+Blitz3D Docs
+
+
+
+
AcceptTCPStream (serverhandle)
+
Parameters
+
+
+
+serverhandle = the server handle assigned when the server was created
+
+
+
+
Description
+
+
+
+Accepts an incoming TCP/IP stream, and returns a TCP/IP stream if one is available, or 0 if not.
+
+See CreateTCPServer and CloseTCPServer.
+
+; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example
+; This code is in two parts, and needs to be run seperately on the same machine
+
+; --- Start first code set ---
+; Create a server and listen for push
+
+svrGame=CreateTCPServer(8080)
+
+If svrGame<>0 Then
+Print "Server started successfully."
+Else
+Print "Server failed to start."
+End
+End If
+
+While Not KeyHit(1)
+strStream=AcceptTCPStream(svrGame)
+If strStream Then
+Print ReadString$(strStream)
+Delay 2000
+End
+Else
+Print "No word from Apollo X yet ..."
+Delay 1000
+End If
+Wend
+
+End
+
+; --- End first code set ---
+
+
+; --- Start second code set ---
+; Copy this code to another instance of Blitz Basic
+; Run the above code first, then run this ... they will 'talk'
+
+; Create a Client and push data
+
+strmGame=OpenTCPStream("127.0.0.1",8080)
+
+If strmGame<>0 Then
+Print "Client Connected successfully."
+Else
+Print "Server failed to connect."
+WaitKey
+End
+End If
+
+; write stream to server
+WriteString strmGame,"Mission Control, this is Apollo X ..."
+Print "Completed sending message to Mission control..."
+
+; --- End second code set ---
+
+
; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example
-; This code is in two parts, and needs to be run seperately on the same machine
+Index
-; --- Start first code set ---
-; Create a server and listen for push
-
-svrGame=CreateTCPServer(8080)
-
-If svrGame<>0 Then
-Print "Server started successfully."
-Else
-Print "Server failed to start."
-End
-End If
-
-While Not KeyHit(1)
-strStream=AcceptTCPStream(svrGame)
-If strStream Then
-Print ReadString$(strStream)
-Delay 2000
-End
-Else
-Print "No word from Apollo X yet ..."
-Delay 1000
-End If
-Wend
-
-End
-
-; --- End first code set ---
-
-
-; --- Start second code set ---
-; Copy this code to another instance of Blitz Basic
-; Run the above code first, then run this ... they will 'talk'
-
-; Create a Client and push data
-
-strmGame=OpenTCPStream("127.0.0.1",8080)
-
-If strmGame<>0 Then
-Print "Client Connected successfully."
-Else
-Print "Server failed to connect."
-WaitKey
-End
-End If
-
-; write stream to server
-WriteString strmGame,"Mission Control, this is Apollo X ..."
-Print "Completed sending message to Mission control..."
-
-; --- End second code set ---
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/After.htm b/_release/help/commands/2d_commands/After.htm
index 41e6464..13295f8 100644
--- a/_release/help/commands/2d_commands/After.htm
+++ b/_release/help/commands/2d_commands/After.htm
@@ -1,43 +1,89 @@
-Command: After After custom_type_variable Definition:
Move the object pointer to the next object in the Type collection.
Parameter Description:
custom_type_variable = not the Type name, but the custom Type name
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
Use this to assign a custom Type object to the next object in the collection.
- See the example.
Example:
; Define a crafts Type
-
Type crafts
- Field x
- Field y
- Field dead
- Field graphic
- End Type
-
; Create 100 crafts, with the unique name of alien
- For t = 1 To 100
- alien.crafts = New crafts
- alien\x = Rnd(0,640)
- alien\y = Rnd(0,480)
- alien\dead = 0
- alien\graphic = 1
- Next
-
; Move to the first object
- alien.crafts = First crafts
+custom_type_variable = not the Type name, but the custom Type name
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+Use this to assign a custom Type object to the next object in the collection. See the example.
+
+
+See also: Type, New, Before, First, Last, Each, Insert, Delete.
+
+; Define a crafts Type
+
+Type crafts
+Field x
+Field y
+Field dead
+Field graphic
+End Type
+
+; Create 100 crafts, with the unique name of alien
+For t = 1 To 100
+alien.crafts = New crafts
+alien\x = Rnd(0,640)
+alien\y = Rnd(0,480)
+alien\dead = 0
+alien\graphic = 1
+Next
+
+; Move to the first object
+alien.crafts = First crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the next alien object
+alien = After alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the last alien object
+alien.crafts = Last crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the second to the last alien object
+alien = Before alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/And.htm b/_release/help/commands/2d_commands/And.htm
index 454dd6c..f39e8c2 100644
--- a/_release/help/commands/2d_commands/And.htm
+++ b/_release/help/commands/2d_commands/And.htm
@@ -1,12 +1,48 @@
-Command: And And Definition:
Logical operator comparative command for testing expressions.
Parameter Description:
None.
Command Description:
AND is a logical operator for doing conditional checks of multiple values and/or expressions. Use this to ensure that two or more conditions are true, usually in an IF ... THEN conditional. See example and see OR, NOT, and XOR.
Example:
; AND example
+
+
+Blitz3D Docs
+
+
+
+
And
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+AND is a logical operator for doing conditional checks of multiple values and/or expressions. Use this to ensure that two or more conditions are true, usually in an IF ... THEN conditional. See example and see OR, NOT, and XOR.
-name$=Input$("Enter your name:")
-pw$=Input$("Password:")
-if name$="Shane" and pw$="bluedog" then
-print "Access granted! Welcome!"
-else
-print "Your name or password was not recogized"
-end if
-
+; AND example
+
+name$=Input$("Enter your name:")
+pw$=Input$("Password:")
+
+if name$="Shane" and pw$="bluedog" then
+print "Access granted! Welcome!"
+else
+print "Your name or password was not recognized"
+end if
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/AppTitle.htm b/_release/help/commands/2d_commands/AppTitle.htm
index 2340101..f8d8916 100644
--- a/_release/help/commands/2d_commands/AppTitle.htm
+++ b/_release/help/commands/2d_commands/AppTitle.htm
@@ -1,5 +1,39 @@
-Command: AppTitle AppTitle string Definition:
Sets the title bar of the program.
Parameter Description:
string = any legal string variable
Command Description:
Allows you to set the text of the program's Title Bar.
Example:
; Set the title bar
+
+
+Blitz3D Docs
+
+
+
+
AppTitle title$[,close_prompt$]
+
Parameters
+
+
+
+title$ - the text that will be displayed in the title bar of the program window
+close_prompt$ (optional) - the text that will be displayed in a message box with 'OK/Cancel' options when a user clicks on the close button. If nothing is specified, the message box will not be displayed and the program will close immediately.
+
+
+
+
Description
+
+
+
+Allows you to set the text of the program's title bar, and 'close program?' message box.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Asc.htm b/_release/help/commands/2d_commands/Asc.htm
index 9dea555..77b72d7 100644
--- a/_release/help/commands/2d_commands/Asc.htm
+++ b/_release/help/commands/2d_commands/Asc.htm
@@ -1,4 +1,38 @@
-Command: Asc Asc (string$) Definition:
Returns the ASCII value of the first letter of a string.
Parameter Description:
string$ = any valid string variable (only the first character's ASCII value will be returned).
Command Description:
This will return the ASCII value of the first letter of a string.
Example:
a$=Input$("Enter a letter:")
-Print "The ASCII value of the letter is:" + Asc(a$)
-
+a$=Input$("Enter a letter:")
+Print "The ASCII value of the letter is:" + Asc(a$)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/AvailVidMem.htm b/_release/help/commands/2d_commands/AvailVidMem.htm
index 0ca733c..97c2bcb 100644
--- a/_release/help/commands/2d_commands/AvailVidMem.htm
+++ b/_release/help/commands/2d_commands/AvailVidMem.htm
@@ -1,2 +1,37 @@
-Command: AvailVidMem() AvailVidMem() Definition:
Returns the available free video memory.
Parameter Description:
None.
Command Description:
This command will return the total bytes of available free video memory. Use this to keep track of your resources!
Example:
Print "Your available video memory is: " + AvailVidMem()
+Print "Your available video memory is: " + AvailVidMem()
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/BackBuffer.htm b/_release/help/commands/2d_commands/BackBuffer.htm
index 88e450d..f1007c0 100644
--- a/_release/help/commands/2d_commands/BackBuffer.htm
+++ b/_release/help/commands/2d_commands/BackBuffer.htm
@@ -1,21 +1,55 @@
-Command: BackBuffer() BackBuffer() Definition:
Indicates the BackBuffer drawing buffer.
Parameter Description:
None.
Command Description:
This is a value usually used with SETBUFFER to denote the secondary non-visible drawing buffer called the Back Buffer. In MOST gaming situations, you will want to be using the BackBuffer() for drawing operations then using Flip to bring that buffer to the FrontBuffer() where it can be seen. There are other uses for the command, but this is the biggie. See SETBUFFER for more info, and check out the example. Once again - if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP.
+This is a value usually used with SETBUFFER to denote the secondary non-visible drawing buffer called the Back Buffer. In MOST gaming situations, you will want to be using the BackBuffer() for drawing operations then using Flip to bring that buffer to the FrontBuffer() where it can be seen. There are other uses for the command, but this is the biggie. See SETBUFFER for more info, and check out the example. Once again - if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP.
+
+; Flip/Backbuffer()/Rect Example
+
+; Set Graphics Mode
+Graphics 640,480
+
+; Go double buffering
+SetBuffer BackBuffer()
+
+; Setup initial locations for the box
+box_x = -20 ; negative so it will start OFF screen
+box_y = 100
+
+While Not KeyHit(1)
+Cls ; Always clear screen first
+Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
+Flip ; Flip it into view
+box_x = box_x + 1 ; Move the box over one pixel
+If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
+Wend
+
+
-; Go double buffering
-SetBuffer BackBuffer()
-
-; Setup initial locations for the box
-box_x = -20 ; negative so it will start OFF screen
-box_y = 100
-
-While Not KeyHit(1)
-Cls ; Always clear screen first
-Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
-Flip ; Flip it into view
-box_x = box_x + 1 ; Move the box over one pixel
-If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/BankSize.htm b/_release/help/commands/2d_commands/BankSize.htm
index 9d29bc7..1fccc3e 100644
--- a/_release/help/commands/2d_commands/BankSize.htm
+++ b/_release/help/commands/2d_commands/BankSize.htm
@@ -1,20 +1,56 @@
-Command: BankSize BankSize (bankhandle) Definition:
Returns the size of a bank.
Parameter Description:
bankhandle=handle assigned to the bank when created.
+; BankSize, ResizeBank, CopyBank Example
+
+; create a bank
+bnkTest=CreateBank(5000)
+
+; Fill it with rand Integers
+For t = 0 To 4999
+PokeByte bnkTest,t,Rand(9)
+Next
+
+; Resize the bank
+ResizeBank bnkTest,10000
+
+; Copy the first half of the bank to the second half
+CopyBank bnkTest,0,bnkTest,5000,5000
+
+; Print final banksize
+Print BankSize(bnkTest)
+
+
+
-; Resize the bank
-ResizeBank bnkTest,10000
+Index
-; Copy the first half of the bank to the second half
-CopyBank bnkTest,0,bnkTest,5000,5000
-
-; Print final banksize
-Print BankSize(bnkTest)
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Before.htm b/_release/help/commands/2d_commands/Before.htm
index 6e1bef6..265faf7 100644
--- a/_release/help/commands/2d_commands/Before.htm
+++ b/_release/help/commands/2d_commands/Before.htm
@@ -1,43 +1,89 @@
-Command: Before Before custom_type_variable Definition:
Move the object pointer to the previous object in the Type collection.
Parameter Description:
custom_type_variable = not the Type name, but the custom Type name
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
Use this to assign a custom Type object to the previous object in the collection.
- See the example.
Example:
; Define a crafts Type
-
Type crafts
- Field x
- Field y
- Field dead
- Field graphic
- End Type
-
; Create 100 crafts, with the unique name of alien
- For t = 1 To 100
- alien.crafts = New crafts
- alien\x = Rnd(0,640)
- alien\y = Rnd(0,480)
- alien\dead = 0
- alien\graphic = 1
- Next
-
; Move to the first object
- alien.crafts = First crafts
+custom_type_variable = not the Type name, but the custom Type name
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+Use this to assign a custom Type object to the previous object in the collection. See the example.
+
+
+See also: Type, New, After, First, Last, Each, Insert, Delete.
+
+; Define a crafts Type
+
+Type crafts
+Field x
+Field y
+Field dead
+Field graphic
+End Type
+
+; Create 100 crafts, with the unique name of alien
+For t = 1 To 100
+alien.crafts = New crafts
+alien\x = Rnd(0,640)
+alien\y = Rnd(0,480)
+alien\dead = 0
+alien\graphic = 1
+Next
+
+; Move to the first object
+alien.crafts = First crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the next alien object
+alien = After alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the last alien object
+alien.crafts = Last crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the second to the last alien object
+alien = Before alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Bin.htm b/_release/help/commands/2d_commands/Bin.htm
index 90045f2..9a40c5e 100644
--- a/_release/help/commands/2d_commands/Bin.htm
+++ b/_release/help/commands/2d_commands/Bin.htm
@@ -1,3 +1,38 @@
-Command: Bin$ Bin$ (integer) Definition:
Converts an integer value to a binary value.
Parameter Description:
integer = any valid integer or integer variable
Command Description:
Converts integer values into binary values. If you don't know what binary is, you don't need to know this command :)
Example:
intValue="64738"
-Print "The binary value of "+intValue+" is: " + bin$(intValue)
+intValue="64738"
+Print "The binary value of "+intValue+" is: " + bin$(intValue)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Case.htm b/_release/help/commands/2d_commands/Case.htm
index 0453757..a126d86 100644
--- a/_release/help/commands/2d_commands/Case.htm
+++ b/_release/help/commands/2d_commands/Case.htm
@@ -1,27 +1,67 @@
-Command: Case Case value Definition:
Begins the set of commands in a SELECT structure if the value of SELECT is met.
Parameter Description:
value = any valid value of the SELECT variable
Command Description:
When using a SELECT structure, the CASE command defines the starting point of command execution if the SELECT value matches the CASE value. If the SELECT value doesn't match the CASE value, the commands following it are ignored until the next CASE, DEFAULT, or END SELECT command is encountered. See SELECT and the example for a better understanding.
Example:
; SELECT/CASE/DEFAULT/END SELECT Example
-; Assign a random number 1-10
-mission=Rnd(1,10)
+
+
+Blitz3D Docs
+
+
+
+
Case value [,value [,value ... ] ]
+
Parameters
+
+
+
+value = any valid value of the SELECT variable
+
+
+
+
Description
+
+
+
+When using a SELECT structure, the CASE command defines the starting point of command execution if the SELECT value matches the CASE value. If the SELECT value doesn't match the CASE value, the commands following it are ignored until the next CASE, DEFAULT, or END SELECT command is encountered. See SELECT and the example for a better understanding.
+
+If multiple values should result in the same outcome, a single CASE statement can be used with each value separated by commas.
+
+If you wish to use ranges for a case statement, or if you wish to test more than one variable, you will need to use a programming trick illustrated in the example below. This involves using SELECT TRUE initially, and then in each Case statement specify a logical expression such as A > 1 AND A < 4.
-; Start the selection process based on the value of 'mission' variable
-Select mission
-; Is mission = 1?
-Case 1
-Print "Your mission is to get the plutonium and get out alive!"
+See also: Select, Default, End Select.
+
+; Advanced SELECT/CASE/DEFAULT/END SELECT Example
+; Assign a random number 1-10
+mission=Rnd(1,10)
+
+; Start the selection process based on the value of 'mission' variable
+Select True
+
+; Is mission = 1?
+Case mission=1
+Print "Your mission is to get the plutonium and get out alive!"
+
+; Is mission = 2?
+Case mission=2
+Print "Your mission is to destroy all enemies!"
+
+; Is mission = 3 to 5
+Case mission>=3 And mission<=5
+Print "Your mission is to steal the enemy building plans!"
+
+; What do do if none of the cases match the value of mission
+Default
+Print "Missions 6-10 are not available yet!"
+
+; End the selection process
+End Select
+
+
+
-; Is mission = 2?
-Case 2
-Print "Your mission is to destroy all enemies!"
+Index
-; Is mission = 3?
-Case 3
-Print "Your mission is to steal the enemy building plans!"
-
-; What do do if none of the cases match the value of mission
-Default
-Print "Missions 4-10 are not available yet!"
-
-; End the selection process
-End Select
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Ceil.htm b/_release/help/commands/2d_commands/Ceil.htm
index d418703..b4d2966 100644
--- a/_release/help/commands/2d_commands/Ceil.htm
+++ b/_release/help/commands/2d_commands/Ceil.htm
@@ -1,12 +1,87 @@
-Command: Ceil# Ceil# (float) Definition:
Rounds a decimal floating variable up to the nearest whole number.
Parameter Description:
float=floating point number
Command Description:
Many times, you will need to round up or down a floating point decimal variable. This command rounds it up to the nearest whole number. Use Floor# to round the number down.
Example:
; Floor#/Ceil# Example
+
+
+Blitz3D Docs
+
+
+
+
Ceil# ( y# )
+
Parameters
+
+
+
+y = any number
+
+
+
+
Description
+
+
+
+As with Floor there is often some confusion with negative numbers:
+
+Ceil( 1.75 ) ...... 2.0
+Ceil( -1.75 ) ... -1.0
+
+See also Floor and Int for other types of rounding.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ChangeDir.htm b/_release/help/commands/2d_commands/ChangeDir.htm
index 14cf4f1..69a70b7 100644
--- a/_release/help/commands/2d_commands/ChangeDir.htm
+++ b/_release/help/commands/2d_commands/ChangeDir.htm
@@ -1,6 +1,40 @@
-Command: ChangeDir ChangeDir directory/path Definition:
Changes the currently selected directory for file operations.
Parameter Description:
directory/path = full path to directory/folder
Command Description:
This command will change the currently selected directory for disk operations, useful for advanced file operations. Use CURRENTDIR$() to see what the current directory is.
-Use a directory/path of ".." to change to the parent of the current directory, unless you are at the root directory of the drive, then no change happens.
Example:
; ChangeDir example
+
+
+Blitz3D Docs
+
+
+
+
ChangeDir directory/path
+
Parameters
+
+
+
+directory/path = full path to directory/folder
+
+
+
+
Description
+
+
+
+This command will change the currently selected directory for disk operations, useful for advanced file operations. Use CURRENTDIR$() to see what the current directory is.
+Use a directory/path of ".." to change to the parent of the current directory, unless you are at the root directory of the drive, then no change happens.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ChannelPan.htm b/_release/help/commands/2d_commands/ChannelPan.htm
index 5f6cc28..92726bf 100644
--- a/_release/help/commands/2d_commands/ChannelPan.htm
+++ b/_release/help/commands/2d_commands/ChannelPan.htm
@@ -1,43 +1,78 @@
-Command: ChannelPan ChannelPan channel_handle, pan# Definition:
Pans sound channel between the left and right channels.
Parameter Description:
channel_handle = variable assigned to the channel when played
-pan# = panning floating value to denote channel playback
Command Description:
When you want to do real sound panning effects, this is the command you'll use. This will allow you to pan the sound channels on a 'per channel' basis between the left and right speakers. This command makes it very easy to produce some really killer stereophonic effects!
+
+
+Blitz3D Docs
+
+
+
+
ChannelPan channel_handle, pan#
+
Parameters
+
+
+
+channel_handle = variable assigned to the channel when played
+pan# = panning floating value to denote channel playback
+
+
+
+
Description
+
+
+
+When you want to do real sound panning effects, this is the command you'll use. This will allow you to pan the sound channels on a 'per channel' basis between the left and right speakers. This command makes it very easy to produce some really killer stereophonic effects!
+
+The pan value is between -1 and 1 with 0 being perfect center. -1 is full left, and 1 is full right. To make it somewhere in between, try -.5 for 50% left or .75 for 75% right.
+
+; Channel examples
+
+Print "Loading sound ..."
+; Load the sample - you'll need to point this to a sound on your computer
+; For best results, make it about 5-10 seconds...
+sndWave=LoadSound("level1.wav")
+; Prepare the sound for looping
+LoopSound sndWave
+
+chnWave=PlaySound(sndWave)
+
+Print "Playing sound for 2 seconds ..."
+Delay 2000
+
+Print "Pausing sound for 2 seconds ..."
+PauseChannel chnWave
+Delay 2000
+
+Print "Restarting sound ..."
+ResumeChannel chnWave
+Delay 2000
+
+Print "Changing Pitch of sound ..."
+ChannelPitch chnWave, 22000
+Delay 2000
+
+Print "Playing new pitched sound ..."
+Delay 2000
+
+Print "Left speaker only"
+ChannelPan chnWave,-1
+Delay 2000
+
+Print "Right speaker only"
+ChannelPan chnWave,1
+Delay 2000
+
+Print "All done!"
+StopChannel chnWave
+
+
+
+
-The pan value is between -1 and 1 with 0 being perfect center. -1 is full left, and 1 is full right. To make it somewhere in between, try -.5 for 50% left or .75 for 75% right.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ChannelPitch.htm b/_release/help/commands/2d_commands/ChannelPitch.htm
index a325f2d..9dd3a0d 100644
--- a/_release/help/commands/2d_commands/ChannelPitch.htm
+++ b/_release/help/commands/2d_commands/ChannelPitch.htm
@@ -1,43 +1,76 @@
-Command: ChannelPitch ChannelPitch channel_handle, hertz Definition:
Alters the hertz pitch of a playing sound channel.
Parameter Description:
channel_handle = variable assigned to the channel when played
-hertz = pitch to apply to the channel (try 8000-44000)
-
Command Description:
You can alter the hertz pitch of a sound channel that is playing (or in use and just paused). I'm sure you can think of numerous uses for this command! Use the frequency of your sound as the 'baseline' for pitch change. So if your sample is at 11025 hertz, increase the pitch to 22050 to make the pitch higher, 8000 to make it lower, etc. While similar to SoundPitch, this command let's you change the pitch individually of each and every channel in use.
Example:
; Channel examples
+
+
+Blitz3D Docs
+
+
+
+
ChannelPitch channel_handle, hertz
+
Parameters
+
+
+
+channel_handle = variable assigned to the channel when played
+hertz = pitch to apply to the channel (try 8000-44000)
+
+
+
+
Description
+
+
+
+You can alter the pitch of a sound channel that is playing (or in use and just paused). I'm sure you can think of numerous uses for this command! Use the frequency of your sound as the 'baseline' for pitch change. So if your sample is at 11025 hertz, increase the pitch to 22050 to make the pitch twice as high, 8000 to make it lower, etc. While similar to SoundPitch, this command let's you change the pitch individually of each and every channel in use.
+
+; Channel examples
+
+Print "Loading sound ..."
+; Load the sample - you'll need to point this to a sound on your computer
+; For best results, make it about 5-10 seconds...
+sndWave=LoadSound("level1.wav")
+; Prepare the sound for looping
+LoopSound sndWave
+
+chnWave=PlaySound(sndWave)
+
+Print "Playing sound for 2 seconds ..."
+Delay 2000
+
+Print "Pausing sound for 2 seconds ..."
+PauseChannel chnWave
+Delay 2000
+
+Print "Restarting sound ..."
+ResumeChannel chnWave
+Delay 2000
+
+Print "Changing Pitch of sound ..."
+;StopChannel chnWave
+ChannelPitch chnWave, 22000
+Delay 2000
+
+Print "Playing new pitched sound ..."
+Delay 2000
+
+Print "Left speaker only"
+ChannelPan chnWave,-1
+Delay 2000
+
+Print "Right speaker only"
+ChannelPan chnWave,1
+Delay 2000
+
+Print "All done!"
+StopChannel chnWave
+
+
+
-Print "Loading sound ..."
-; Load the sample - you'll need to point this to a sound on your computer
-; For best results, make it about 5-10 seconds...
-sndWave=LoadSound("level1.wav")
-; Prepare the sound for looping
-LoopSound sndWave
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ChannelPlaying.htm b/_release/help/commands/2d_commands/ChannelPlaying.htm
index 4535528..5bbc971 100644
--- a/_release/help/commands/2d_commands/ChannelPlaying.htm
+++ b/_release/help/commands/2d_commands/ChannelPlaying.htm
@@ -1,16 +1,50 @@
-Command: ChannelPlaying ChannelPlaying (channel_handle) Definition:
Checks to see if a sound channel is still playing.
Parameter Description:
channel_handle = variable assigned to the channel when played
Command Description:
Often you will need to know if a sound channel has completed playing or not. This command will return 1 if the sound is still playing or 0 if it has stopped. Use this to restart your background music or some other sound that might have stopped unintentionally.
+
+
+Blitz3D Docs
+
+
+
+
ChannelPlaying (channel_handle)
+
Parameters
+
+
+
+channel_handle = variable assigned to the channel when played
+
+
+
+
Description
+
+
+
+Often you will need to know if a sound channel has completed playing or not. This command will return 1 if the sound is still playing or 0 if it has stopped. Use this to restart your background music or some other sound that might have stopped unintentionally.
+
+Note: This command currently doesn't seem to work with a channel assigned to CD track playback.
+
+; Channel examples
+
+Print "Loading sound ..."
+; Load the sample - you'll need to point this to a sound on your computer
+; For best results, make it about 5-10 seconds...
+sndWave=LoadSound("level1.wav")
+
+Print "Playing full sample until sound is done ..."
+chnWave=PlaySound(sndWave)
+While ChannelPlaying(chnWave)
+Wend
+Print "All done!"
+
+
+
+
-Note: This command currently doesn't seem to work with a channel assigned to CD track playback.
-Print "Loading sound ..."
-; Load the sample - you'll need to point this to a sound on your computer
-; For best results, make it about 5-10 seconds...
-sndWave=LoadSound("level1.wav")
-
-Print "Playing full sample until sound is done ..."
-chnWave=PlaySound(sndWave)
-While ChannelPlaying(chnWave)
-Wend
-
-Print "All done!"
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ChannelVolume.htm b/_release/help/commands/2d_commands/ChannelVolume.htm
index 67f71b4..2db218a 100644
--- a/_release/help/commands/2d_commands/ChannelVolume.htm
+++ b/_release/help/commands/2d_commands/ChannelVolume.htm
@@ -1,43 +1,78 @@
-Command: ChannelVolume ChannelVolume channel_handle, volume# Definition:
Adjusts the volume level of a sound channel.
Parameter Description:
channel_handle = variable assigned to the channel when played
-volume# = volume level floating value between 0 and 1
Command Description:
While SoundVolume happily changes the volume of the entire program, this command will let you adjust volume rates on a 'per channel' basis. Extremely useful.
+
+
+Blitz3D Docs
+
+
+
+
ChannelVolume channel_handle, volume#
+
Parameters
+
+
+
+channel_handle = variable assigned to the channel when played
+volume# = volume level floating value between 0 and 1
+
+
+
+
Description
+
+
+
+While SoundVolume happily changes the volume of the entire program, this command will let you adjust volume rates on a 'per channel' basis. Extremely useful.
+
+The volume value is a floating point value between 0 and 1 (0 = silence, .5 = half volume, 1= full volume). You can do other cool stuff like ChannelPitch and ChannelPan too!
+
+; Channel examples
+
+Print "Loading sound ..."
+; Load the sample - you'll need to point this to a sound on your computer
+; For best results, make it about 5-10 seconds...
+sndWave=LoadSound("level1.wav")
+; Prepare the sound for looping
+LoopSound sndWave
+
+chnWave=PlaySound(sndWave)
+
+Print "Playing sound for 2 seconds ..."
+Delay 2000
+
+Print "Pausing sound for 2 seconds ..."
+PauseChannel chnWave
+Delay 2000
+
+Print "Restarting sound ..."
+ResumeChannel chnWave
+Delay 2000
+
+Print "Changing volume of sound ..."
+ChannelVolume chnWave, .5
+Delay 2000
+
+Print "Playing new half-volume sound ..."
+Delay 2000
+
+Print "Left speaker only"
+ChannelPan chnWave,-1
+Delay 2000
+
+Print "Right speaker only"
+ChannelPan chnWave,1
+Delay 2000
+
+Print "All done!"
+StopChannel chnWave
+
+
+
+
-The volume value is a floating point value between 0 and 1 (0 = silence, .5 = half volume, 1= full volume). You can do other cool stuff like ChannelPitch and ChannelPan too!
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Chr.htm b/_release/help/commands/2d_commands/Chr.htm
index 7d4c288..7335cee 100644
--- a/_release/help/commands/2d_commands/Chr.htm
+++ b/_release/help/commands/2d_commands/Chr.htm
@@ -1,2 +1,37 @@
-Command: Chr$ Chr$ (integer) Definition:
Converts an ASCII code to its corresponding character string.
Parameter Description:
integer = valid ASCII code integer value
Command Description:
Use this command to convert a known ASCII code (for example 65) to its character string equivelant (i.e. the letter "A").
Example:
Print " The character for ASCII value 65 is: " + Chr$(65)
+Print " The character for ASCII value 65 is: " + Chr$(65)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CloseDir.htm b/_release/help/commands/2d_commands/CloseDir.htm
index 2c9877d..3f9ae99 100644
--- a/_release/help/commands/2d_commands/CloseDir.htm
+++ b/_release/help/commands/2d_commands/CloseDir.htm
@@ -1,32 +1,66 @@
-Command: CloseDir CloseDir filehandle Definition:
Closes a directory previously opened with the ReadDir command.
Parameter Description:
filehandle = valid filehandle assigned from the ReadDir command
Command Description:
Once you are finished with NextFile$ on the directory previously opened for read with the ReadDir command, use this command to close the directory. This is good programming practice!
-
+filehandle = valid filehandle assigned from the ReadDir command
+
+
+
+
Description
+
+
+
+Once you are finished with NextFile$ on the directory previously opened for read with the ReadDir command, use this command to close the directory. This is good programming practice!
+
+See also: ReadDir, NextFile$
+
+; ReadDir/NextFile$/CloseDir example
+
+; Define what folder to start with ...
+folder$="C:"
+
+; Open up the directory, and assign the handle to myDir
+myDir=ReadDir(folder$)
+
+; Let's loop forever until we run out of files/folders to list!
+Repeat
+; Assign the next entry in the folder to file$
+file$=NextFile$(myDir)
+
+; If there isn't another one, let's exit this loop
+If file$="" Then Exit
+
+; Use FileType to determine if it is a folder (value 2) or a file and print results
+If FileType(folder$+"\"+file$) = 2 Then
+Print "Folder:" + file$
+Else
+Print "File:" + file$
+End If
+Forever
+
+; Properly close the open folder
+CloseDir myDir
+
+; We're done!
+Print "Done listing files!"
+
+
+
-; Define what folder to start with ...
-folder$="C:\"
+Index
-; Open up the directory, and assign the handle to myDir
-myDir=ReadDir(folder$)
-
-; Let's loop forever until we run out of files/folders to list!
-Repeat
-; Assign the next entry in the folder to file$
-file$=NextFile$(myDir)
-
-; If there isn't another one, let's exit this loop
-If file$="" Then Exit
-
-; Use FileType to determine if it is a folder (value 2) or a file and print results
-If FileType(folder$+"\"+file$) = 2 Then
-Print "Folder:" + file$
-Else
-Print "File:" + file$
-End If
-Forever
-
-; Properly close the open folder
-CloseDir myDir
-
-; We're done!
-Print "Done listing files!"
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CloseFile.htm b/_release/help/commands/2d_commands/CloseFile.htm
index 4b1f3f4..838f981 100644
--- a/_release/help/commands/2d_commands/CloseFile.htm
+++ b/_release/help/commands/2d_commands/CloseFile.htm
@@ -1,51 +1,82 @@
-Command: CloseFile CloseFile filehandle Definition:
Closes a file previously opened with a file operations command.
Parameter Description:
filehandle = variable defined with the WriteFile or OpenFile command
Command Description:
Use this command to close a file previously opened. You should always close a file as soon as you have finished reading or writing to it.
+
+
+Blitz3D Docs
+
+
+
+
CloseFile filehandle
+
Parameters
+
+
+
+filehandle = variable defined with the WriteFile or OpenFile command
+
+
+
+
Description
+
+
+
+Use this command to close a file previously opened. You should always close a file as soon as you have finished reading or writing to it.
+
; Reading and writing custom types to files using ReadFile, WriteFile and CloseFile
+Index
-; Initialise some variables for the example
-Type HighScore
- Field Name$
- Field Score%
- Field Level%
-End Type
-
-Best.HighScore = New HighScore
-Best\Name = "Mark"
-Best\Score = 11657
-Best\Level = 34
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteString( fileout, Best\Name )
-WriteInt( fileout, Best\Score )
-WriteByte( fileout, Best\Level )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-; Lets read the Greatest score from the file
-Greatest.HighScore = New HighScore
-Greatest\Name$ = ReadString$( filein )
-Greatest\Score = ReadInt( filein )
-Greatest\Level = ReadByte( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "High score record read from - mydata.dat "
-Print
-Write "Name = "
-Print Greatest\Name
-Write "Score = "
-Print Greatest\Score
-Write "Level = "
-Print Greatest\Level
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CloseTCPServer.htm b/_release/help/commands/2d_commands/CloseTCPServer.htm
index 2aa61a0..d4b4d21 100644
--- a/_release/help/commands/2d_commands/CloseTCPServer.htm
+++ b/_release/help/commands/2d_commands/CloseTCPServer.htm
@@ -1,55 +1,89 @@
-Command: CloseTCPServer CloseTCPServer serverhandle Definition:
Closes a TCP server.
Parameter Description:
serverhandle = handle assigned when the server was created.
Command Description:
Closes a TCP/IP server previously created with the CreateTCPServer command.
Example:
; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example
-; This code is in two parts, and needs to be run seperately on the same machine
+
+
+Blitz3D Docs
+
+
+
+
CloseTCPServer serverhandle
+
Parameters
+
+
+
+serverhandle = handle assigned when the server was created.
+
+
+
+
Description
+
+
+
+Closes a TCP/IP server previously created with the CreateTCPServer command.
+
+; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example
+; This code is in two parts, and needs to be run seperately on the same machine
+
+; --- Start first code set ---
+; Create a server and listen for push
+
+svrGame=CreateTCPServer(8080)
+
+If svrGame<>0 Then
+Print "Server started successfully."
+Else
+Print "Server failed to start."
+End
+End If
+
+While Not KeyHit(1)
+strStream=AcceptTCPStream(svrGame)
+If strStream Then
+Print ReadString$(strStream)
+Delay 2000
+End
+Else
+Print "No word from Apollo X yet ..."
+Delay 1000
+End If
+Wend
+
+End
+
+; --- End first code set ---
+
+
+; --- Start second code set ---
+; Copy this code to another instance of Blitz Basic
+; Run the above code first, then run this ... they will 'talk'
+
+; Create a Client and push data
+
+strmGame=OpenTCPStream("127.0.0.1",8080)
+
+If strmGame<>0 Then
+Print "Client Connected successfully."
+Else
+Print "Server failed to connect."
+WaitKey
+End
+End If
+
+; write stream to server
+WriteString strmGame,"Mission Control, this is Apollo X ..."
+Print "Completed sending message to Mission control..."
+
+; --- End second code set ---
+
+
+
+
-; --- Start first code set ---
-; Create a server and listen for push
+Index
-svrGame=CreateTCPServer(8080)
-
-If svrGame<>0 Then
-Print "Server started successfully."
-Else
-Print "Server failed to start."
-End
-End If
-
-While Not KeyHit(1)
-strStream=AcceptTCPStream(svrGame)
-If strStream Then
-Print ReadString$(strStream)
-Delay 2000
-End
-Else
-Print "No word from Apollo X yet ..."
-Delay 1000
-End If
-Wend
-
-End
-
-; --- End first code set ---
-
-
-; --- Start second code set ---
-; Copy this code to another instance of Blitz Basic
-; Run the above code first, then run this ... they will 'talk'
-
-; Create a Client and push data
-
-strmGame=OpenTCPStream("127.0.0.1",8080)
-
-If strmGame<>0 Then
-Print "Client Connected successfully."
-Else
-Print "Server failed to connect."
-WaitKey
-End
-End If
-
-; write stream to server
-WriteString strmGame,"Mission Control, this is Apollo X ..."
-Print "Completed sending message to Mission control..."
-
-; --- End second code set ---
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CloseTCPStream.htm b/_release/help/commands/2d_commands/CloseTCPStream.htm
index e21007b..2c41e1a 100644
--- a/_release/help/commands/2d_commands/CloseTCPStream.htm
+++ b/_release/help/commands/2d_commands/CloseTCPStream.htm
@@ -1,27 +1,62 @@
-Command: CloseTCPStream CloseTCPStream streamhandle Definition:
Closes the specified TCP stream.
Parameter Description:
streamhandle = handle assigned when the stream was opened.
Command Description:
Once you've completed the use of your TCP/IP stream, close the connection you opened with OpenTCPStream with this command.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Cls.htm b/_release/help/commands/2d_commands/Cls.htm
index 70185d9..ef1fc44 100644
--- a/_release/help/commands/2d_commands/Cls.htm
+++ b/_release/help/commands/2d_commands/Cls.htm
@@ -1,2 +1,40 @@
-Command: Cls Cls Definition:
Clears the current current drawing buffer.
Parameter Description:
None.
Command Description:
This command will wipe the current drawing buffer clean of any graphics or text present and reset the drawing buffer back to the color defined in the ClsColor command
Example:
;set ClsColor to red ClsColor 255,0,0
;set current drawing buffer to the color set by the ClsColor command Cls
+This command will wipe the current drawing buffer clean of any graphics or text present and reset the drawing buffer back to the color defined in the ClsColor command
+
+;set ClsColor to red
+ClsColor 255,0,0
+
+;set current drawing buffer to the color set by the ClsColor command
+Cls
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ClsColor.htm b/_release/help/commands/2d_commands/ClsColor.htm
index 9ce6c6d..d8973b4 100644
--- a/_release/help/commands/2d_commands/ClsColor.htm
+++ b/_release/help/commands/2d_commands/ClsColor.htm
@@ -1,2 +1,40 @@
-Command: ClsColor ClsColor red,green,blue Definition:
Selects the color for the Cls command.
Parameter Description:
red, green and blue = number between 0 and 255
Command Description:
This changes the color for subsequent CLS calls. Use this command when you need CLS to 'clear' the screen with some other color than black.
Example:
;set ClsColor to red ClsColor 255,0,0
;set current drawing buffer to the color set by the ClsColor command Cls
+;set ClsColor to red
+ClsColor 255,0,0
+
+;set current drawing buffer to the color set by the ClsColor command
+Cls
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Color.htm b/_release/help/commands/2d_commands/Color.htm
index 054bb85..0058aff 100644
--- a/_release/help/commands/2d_commands/Color.htm
+++ b/_release/help/commands/2d_commands/Color.htm
@@ -1,19 +1,53 @@
-Command: Color Color red,green,blue Definition:
Sets the drawing color for all drawing operations with a red, green, blue color value.
Parameter Description:
red = value of red component (0-255)
-green = value of green component (0-255)
-blue = value of blue component (0-255)
Command Description:
This command sets the drawing color (using RGB values) for all subsequent drawing commands (Line, Rect, Text, etc.) You must be in Graphics mode to execute this command.
+red = value of red component (0-255)
+green = value of green component (0-255)
+blue = value of blue component (0-255)
+
+
+
+
Description
+
+
+
+This command sets the drawing color (using RGB values) for all subsequent drawing commands (Line, Rect, Text, etc.) You must be in Graphics mode to execute this command.
+
+; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+
+; Gotta be in graphics mode
+Graphics 640,480
+
+; Change the random seed
+SeedRnd MilliSecs()
+
+; Let's set the color to something random
+Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
+
+; Now let's see what they are!
+While Not KeyHit(1)
+Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
+Wend
+
+
+
+
-; Gotta be in graphics mode
-Graphics 640,480
+Index
-; Change the random seed
-SeedRnd MilliSecs()
-
-; Let's set the color to something random
-Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
-
-; Now let's see what they are!
-While Not KeyHit(1)
-Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ColorBlue.htm b/_release/help/commands/2d_commands/ColorBlue.htm
index ec0beb1..2b1e592 100644
--- a/_release/help/commands/2d_commands/ColorBlue.htm
+++ b/_release/help/commands/2d_commands/ColorBlue.htm
@@ -1,17 +1,51 @@
-Command: ColorBlue() ColorBlue() Definition:
Returns the blue component of the current drawing color.
Parameter Description:
None.
Command Description:
Use this command to return the blue component of the RGB color of the current drawing color. Use ColorRed() and ColorGreen() for the other two color components.
+Use this command to return the blue component of the RGB color of the current drawing color. Use ColorRed() and ColorGreen() for the other two color components.
+
+; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+
+; Gotta be in graphics mode
+Graphics 640,480
+
+; Change the random seed
+SeedRnd MilliSecs()
+
+; Let's set the color to something random
+Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
+
+; Now let's see what they are!
+While Not KeyHit(1)
+Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
+Wend
+
+
+
+
-; Gotta be in graphics mode
-Graphics 640,480
+Index
-; Change the random seed
-SeedRnd MilliSecs()
-
-; Let's set the color to something random
-Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
-
-; Now let's see what they are!
-While Not KeyHit(1)
-Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ColorGreen.htm b/_release/help/commands/2d_commands/ColorGreen.htm
index 1c1cd98..74ba05d 100644
--- a/_release/help/commands/2d_commands/ColorGreen.htm
+++ b/_release/help/commands/2d_commands/ColorGreen.htm
@@ -1,17 +1,51 @@
-Command: ColorGreen() ColorGreen() Definition:
Returns the green component of the current drawing color.
Parameter Description:
None.
Command Description:
Use this command to return the green component of the RGB color of the current drawing color. Use ColorRed() and ColorBlue() for the other two color components.
+Use this command to return the green component of the RGB color of the current drawing color. Use ColorRed() and ColorBlue() for the other two color components.
+
+; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+
+; Gotta be in graphics mode
+Graphics 640,480
+
+; Change the random seed
+SeedRnd MilliSecs()
+
+; Let's set the color to something random
+Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
+
+; Now let's see what they are!
+While Not KeyHit(1)
+Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
+Wend
+
+
+
+
-; Gotta be in graphics mode
-Graphics 640,480
+Index
-; Change the random seed
-SeedRnd MilliSecs()
-
-; Let's set the color to something random
-Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
-
-; Now let's see what they are!
-While Not KeyHit(1)
-Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ColorRed.htm b/_release/help/commands/2d_commands/ColorRed.htm
index 61dc109..928070c 100644
--- a/_release/help/commands/2d_commands/ColorRed.htm
+++ b/_release/help/commands/2d_commands/ColorRed.htm
@@ -1,17 +1,51 @@
-Command: ColorRed() ColorRed() Definition:
Returns the red component of the current drawing color.
Parameter Description:
None.
Command Description:
Use this command to return the red component of the RGB color of the current drawing color. Use ColorBlue() and ColorGreen() for the other two color components.
+Use this command to return the red component of the RGB color of the current drawing color. Use ColorBlue() and ColorGreen() for the other two color components.
+
+; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+
+; Gotta be in graphics mode
+Graphics 640,480
+
+; Change the random seed
+SeedRnd MilliSecs()
+
+; Let's set the color to something random
+Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
+
+; Now let's see what they are!
+While Not KeyHit(1)
+Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
+Wend
+
+
+
+
-; Gotta be in graphics mode
-Graphics 640,480
+Index
-; Change the random seed
-SeedRnd MilliSecs()
-
-; Let's set the color to something random
-Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
-
-; Now let's see what they are!
-While Not KeyHit(1)
-Text 0,0,"This Text is printed in Red=" + ColorRed() + " Green=" + ColorGreen() + " Blue=" + ColorBlue() + "!"
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CommandLine.htm b/_release/help/commands/2d_commands/CommandLine.htm
index b25ec87..377bb69 100644
--- a/_release/help/commands/2d_commands/CommandLine.htm
+++ b/_release/help/commands/2d_commands/CommandLine.htm
@@ -1,20 +1,54 @@
-Command: CommandLine$() CommandLine$() Definition:
Reads command line parameters passed at runtime.
Parameter Description:
None.
Command Description:
If you are writing an application or game that allows starting with special parameters on the command line, you can use this command to retrieve the parameters.
+
+
+Blitz3D Docs
+
+
+
+
CommandLine$()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+If you are writing an application or game that allows starting with special parameters on the command line, you can use this command to retrieve the parameters.
+
+For example, you might want to start the program with a debug variable set so you can track stuff during execution. So, you could offer the ability to run the executatble with a /debug parameter. If they execute the program with the parameter, then you can set a flag inside your game.
+
+To simulate the command line passing in the editor, select PROGRAM->PROGRAM COMMAND LINE from the pulldowns and enter a value to be passed at runtime.
+
+See the example.
+
+; CommandLine$() Example
+; Be sure to use PROGRAM->PROGRAM COMMAND LINE from the
+; pull down and put /debug in there to test with.
+
+a$=CommandLine$()
+
+If a$="/debug" Then
+Print "Debug mode is on!"
+debug=1
+Else
+Print "No debugging activated."
+debug=0
+End If
+
+
+
-For example, you might want to start the program with a debug variable set so you can track stuff during execution. So, you could offer the ability to run the executatble with a /debug parameter. If they execute the program with the parameter, then you can set a flag inside your game.
+Index
-To simulate the command line passing in the editor, select PROGRAM->PROGRAM COMMAND LINE from the pulldowns and enter a value to be passed at runtime.
-
-See the example.
Example:
; CommandLine$() Example
-; Be sure to use PROGRAM->PROGRAM COMMAND LINE from the
-; pull down and put /debug in there to test with.
-
-a$=CommandLine$()
-
-If a$="/debug" Then
-Print "Debug mode is on!"
-debug=1
-Else
-Print "No debugging activated."
-debug=0
-End If
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Const.htm b/_release/help/commands/2d_commands/Const.htm
index 2edbb3d..cf5c62f 100644
--- a/_release/help/commands/2d_commands/Const.htm
+++ b/_release/help/commands/2d_commands/Const.htm
@@ -1,13 +1,49 @@
-Command: Const Const variablename Definition:
Declare a variable as a constant and assign it a value.
Parameter Description:
variablename = any valid variable name and its assignment
Command Description:
This delares a variable as a constant (a variable whose value will never change and cannot be changed) and assigns the value to it.
+
+
+Blitz3D Docs
+
+
+
+
Const variablename
+
Parameters
+
+
+
+variablename - any valid variable name and its assignment
+
+
+
+
Description
+
+
+
+This declares a variable as a constant (a variable whose value will never change and cannot be changed) and assigns the value to it.
+
+Assign constants to values you know will not change in your game (screen width, height - scoring values - etc). This reduces the load of the variable memory, since Blitz knows it will never change size unlike other variables which can grow and shrink in size based on what value it holds.
-Assign constants to values you know will not change in your game (screen width, height - scoring values - etc). This reduces the load of the variable memory, since Blitz knows it will never change size unlike other variables which can grow and shrink in size based on what value it holds.
+; CONST Example
+
+Const scrWidth=640
+Const scrHeight=480
+Const alienscore=100
+
+Graphics scrWidth,scrHeight
+
+Print "The point value for shooting any alien is always " + alienscore
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CopyBank.htm b/_release/help/commands/2d_commands/CopyBank.htm
index 49a939f..6622397 100644
--- a/_release/help/commands/2d_commands/CopyBank.htm
+++ b/_release/help/commands/2d_commands/CopyBank.htm
@@ -1,24 +1,57 @@
-Command: CopyBank CopyBank src_bank,src_offset,dest_bank,dest_offset,count Definition:
Copies data from one bank to another.
Parameter Description:
src_bank = handle of source memory bank
-src_offset = offset location to start copying from
-dest_bank = handle of destination memory bank
-dest_offset = offset location to start writing to
-count = how many bytes to copy
Command Description:
Copies data from one meomry bank to another. If copying between the same banks, handles overlapping memory ranges.
+src_bank = handle of source memory bank
+src_offset = offset location to start copying from
+dest_bank = handle of destination memory bank
+dest_offset = offset location to start writing to
+count = how many bytes to copy
+
+; BankSize, ResizeBank, CopyBank Example
+
+; create a bank
+bnkTest=CreateBank(5000)
+
+; Fill it with rand Integers
+For t = 0 To 4999
+PokeByte bnkTest,t,Rand(9)
+Next
+
+; Resize the bank
+ResizeBank bnkTest,10000
+
+; Copy the first half of the bank to the second half
+CopyBank bnkTest,0,bnkTest,5000,5000
+
+; Print final banksize
+Print BankSize(bnkTest)
+
-; Fill it with rand Integers
-For t = 0 To 4999
-PokeByte bnkTest,t,Rand(9)
-Next
-
-; Resize the bank
-ResizeBank bnkTest,10000
-
-; Copy the first half of the bank to the second half
-CopyBank bnkTest,0,bnkTest,5000,5000
-
-; Print final banksize
-Print BankSize(bnkTest)
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CopyFile.htm b/_release/help/commands/2d_commands/CopyFile.htm
index 72ad4e7..581b8d2 100644
--- a/_release/help/commands/2d_commands/CopyFile.htm
+++ b/_release/help/commands/2d_commands/CopyFile.htm
@@ -1,11 +1,44 @@
-Command: CopyFile CopyFile from$, to$ Definition:
Copies a file on the disk to a new location.
Parameter Description:
from$ = valid path/filename to the file to be copied
-to$ = valid path/filename to copy the file to
Command Description:
Use this command to copy a file from one location to another. Perhaps you'll write your own installer and need to copy files from the installation folder to the installed location folder. Make sure you do your own validation to ensure that the files/paths are valid and accurate before executing this command.
+from$ = valid path/filename to the file to be copied
+to$ = valid path/filename to copy the file to
+
+
+
+
Description
+
+
+
+Use this command to copy a file from one location to another. Perhaps you'll write your own installer and need to copy files from the installation folder to the installed location folder. Make sure you do your own validation to ensure that the files/paths are valid and accurate before executing this command.
+
+file$="c:autoexec.bat"
+destination$="a:autoexec.bat"
+
+Print "Press any key to copy your Autoexec.bat file to floppy"
+
+WaitKey()
+
+CopyFile file$,destination$
+
+
+
-Print "Press any key to copy your Autoexec.bat file to floppy"
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CopyImage.htm b/_release/help/commands/2d_commands/CopyImage.htm
index f532f2c..bddd13f 100644
--- a/_release/help/commands/2d_commands/CopyImage.htm
+++ b/_release/help/commands/2d_commands/CopyImage.htm
@@ -1,11 +1,45 @@
-Command: CopyImage CopyImage (handle) Definition:
Duplicates a previously loaded image to a new handle.
Parameter Description:
handle=the variable you gave the handle to when you loaded the image
Command Description:
Instead of loading a graphic twice in two different handles, you can load the image ONCE then use the CopyImage command to make as many copies in memory as you want.
+
+
+Blitz3D Docs
+
+
+
+
CopyImage (handle)
+
Parameters
+
+
+
+handle=the variable you gave the handle to when you loaded the image
+
+
+
+
Description
+
+
+
+Instead of loading a graphic twice in two different handles, you can load the image ONCE then use the CopyImage command to make as many copies in memory as you want.
+
+Why would you want to do this? So you still have a copy of the original image in case you want to alter a copy later for another purpose.
+
+; CopyImage Example
+
+; Load an image and give its handle to gfxOld variable
+gfxOld=LoadImage("mypicture.bmp")
+
+; Duplicate the gfxOld image to a new handle variable
+gfxNew=CopyImage(gfxOld)
+
+
+
+
-Why would you want to do this? So you still have a copy of the original image in case you want to alter a copy later for another purpose.
-; Load an image and give its handle to gfxOld variable
-gfxOld=LoadImage("mypicture.bmp")
-
-; Duplicate the gfxOld image to a new handle variable
-gfxNew=CopyImage(gfxOld)
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CopyPixel.htm b/_release/help/commands/2d_commands/CopyPixel.htm
index 29bf861..8708664 100644
--- a/_release/help/commands/2d_commands/CopyPixel.htm
+++ b/_release/help/commands/2d_commands/CopyPixel.htm
@@ -1,40 +1,80 @@
-Command: CopyPixel CopyPixel src_x,src_y,src_buffer,dest_x,dest_y,[dest_buffer] Definition:
Copys pixels from one image buffer to another.
Parameter Description:
src_x = x location of the source pixel to copy
-src_y = y location of the source pixel to copy
-src_buffer = buffer to copy from
-dest_x = x location to write pixel to
-dest_y = y location to write pixel to
-dest_buffer = optional
Command Description:
Use this to directly copy pixels from one buffer to another. You do not need to LockBuffer to use this command, but it will make the operations faster.
+
+
+Blitz3D Docs
+
+
+
+
+src_x - x-coordinate of source pixel to copy from
+src_y - y-coordinate of source pixel to copy from
+src_buffer - name of buffer to copy from, e.g. ImageBuffer()
+dest_x - x-coordinate of destination pixel to copy to
+dest_y - y-coordinate of destination pixel to copy to
+dest_buffer (optional) - name of buffer to copy to, e.g. BackBuffer()
+
+
+
+
Description
+
+
+
+You can use this command on a locked buffer for a slight speed-up. See LockBuffer.
+
+See also: CopyPixelFast.
+
+; CopyPixel/CopyPixelFast Example
+; -------------------------------
+
+Graphics 640,480,16
+
+Print "Press a key to use CopyPixel to copy the top half of an image to the frontbuffer"
+WaitKey()
+
+; Load an image - can be anything
+pic=LoadImage("media/blitz_pic.bmp")
+
+; Use CopyPixel to copy the top half of the image to the frontbuffer
+For y=0 To ImageHeight(pic)/2
+For x=0 To ImageWidth(pic)
+CopyPixel x,y,ImageBuffer(pic),x,y
+Next
+Next
+
+Locate 0,GraphicsHeight()/2
+Print "Press a key to use CopyPixelFast to copy the bottom half of the image"
+Print "Once this has finished, you can then press a key to end the program"
+
+WaitKey()
+
+; Lock buffer before using CopyPixelFast
+LockBuffer
+
+; Use CopyPixelFast to copy the bottom half of the image to the frontbuffer
+For y=0 To (ImageHeight(pic)/2)+ImageHeight(pic)
+For x=0 To ImageWidth(pic)
+CopyPixelFast x,y,ImageBuffer(pic),x,y
+Next
+Next
+
+; Unlock buffer after using CopyPixelFast
+UnlockBuffer
+
+WaitKey()
+
+
+
-Although fast, this command will not be fast enough to perform real-time screen effects.
-Graphics 640,480,16
-
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
-
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-For x = 1 To 640
-For y = 1 To 240
-LockBuffer FrontBuffer()
-CopyPixelFast x,y,FrontBuffer(),x,y+241
-UnlockBuffer FrontBuffer()
-Next
-Next
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-CopyPixel x,y,FrontBuffer(),x+320,y
-Next
-Next
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CopyPixelFast.htm b/_release/help/commands/2d_commands/CopyPixelFast.htm
index b4cce6b..731649f 100644
--- a/_release/help/commands/2d_commands/CopyPixelFast.htm
+++ b/_release/help/commands/2d_commands/CopyPixelFast.htm
@@ -1,40 +1,88 @@
-Command: CopyPixelFast CopyPixelFast src_x,src_y,src_buffer,dest_x,dest_y,[dest_buffer] Definition:
Quickly copies pixels from one image buffer to another.
Parameter Description:
src_x = x location of the source pixel to copy
-src_y = y location of the source pixel to copy
-src_buffer = buffer to copy from
-dest_x = x location to write pixel to
-dest_y = y location to write pixel to
-dest_buffer = optional
Command Description:
Use this to directly copy pixels from one buffer to another. You MUST use LockBuffer on BOTH image buffers to use this command.
+
+
+Blitz3D Docs
+
+
+
+
+src_x - x-coordinate of source pixel to copy from
+src_y - y-coordinate of source pixel to copy from
+src_buffer - name of buffer to copy from, e.g. ImageBuffer()
+dest_x - x-coordinate of destination pixel to copy to
+dest_y - y-coordinate of destination pixel to copy to
+dest_buffer (optional) - name of buffer to copy to, e.g. BackBuffer()
+
+
+
+
Description
+
+
+
+IMPORTANT:
+
+You *must* use this command on a locked buffer, otherwise the command will fail. See LockBuffer.
+
+Also, you must make sure that the coordinates that you are copying from and to are valid, otherwise you will end up overwriting other areas of memory.
+
+WARNING:
+
+By not following the above advice, you may cause your computer to crash.
+
+See also: CopyPixel.
+
+; CopyPixel/CopyPixelFast Example
+; -------------------------------
+
+Graphics 640,480,16
+
+Print "Press a key to use CopyPixel to copy the top half of an image to the frontbuffer"
+WaitKey()
+
+; Load an image - can be anything
+pic=LoadImage("media/blitz_pic.bmp")
+
+; Use CopyPixel to copy the top half of the image to the frontbuffer
+For y=0 To ImageHeight(pic)/2
+For x=0 To ImageWidth(pic)
+CopyPixel x,y,ImageBuffer(pic),x,y
+Next
+Next
+
+Locate 0,GraphicsHeight()/2
+Print "Press a key to use CopyPixelFast to copy the bottom half of the image"
+Print "Once this has finished, you can then press a key to end the program"
+
+WaitKey()
+
+; Lock buffer before using CopyPixelFast
+LockBuffer
+
+; Use CopyPixelFast to copy the bottom half of the image to the frontbuffer
+For y=0 To (ImageHeight(pic)/2)+ImageHeight(pic)
+For x=0 To ImageWidth(pic)
+CopyPixelFast x,y,ImageBuffer(pic),x,y
+Next
+Next
+
+; Unlock buffer after using CopyPixelFast
+UnlockBuffer
+
+WaitKey()
+
+
+
-Although very fast, this command will not be fast enough to perform real-time screen effects.
-Graphics 640,480,16
-
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
-
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-For x = 1 To 640
-For y = 1 To 240
-LockBuffer FrontBuffer()
-CopyPixelFast x,y,FrontBuffer(),x,y+241
-UnlockBuffer FrontBuffer()
-Next
-Next
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-CopyPixel x,y,FrontBuffer(),x+320,y
-Next
-Next
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CopyRect.htm b/_release/help/commands/2d_commands/CopyRect.htm
index e71d407..374a4de 100644
--- a/_release/help/commands/2d_commands/CopyRect.htm
+++ b/_release/help/commands/2d_commands/CopyRect.htm
@@ -1,33 +1,67 @@
-Command: CopyRect CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y,[src_buffer],[dest_buffer] Definition:
Copies a rectangle of graphics from one buffer to another.
Parameter Description:
src_x = source top left x location to begin copying from
-src_y = source top left y location to begin copying from
-src_width = width of source area to copy
-src_height = height of source area to copy
-dest_x = destination top left x location to copy to
-dest_y = destination top left y location to copy to
-src_buffer = handle to the source image buffer (optional)
-dest_buffer = handle to the destination image buffer (optional)
-
Command Description:
Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.
+src_x = source top left x location to begin copying from
+src_y = source top left y location to begin copying from
+src_width = width of source area to copy
+src_height = height of source area to copy
+dest_x = destination top left x location to copy to
+dest_y = destination top left y location to copy to
+src_buffer = handle to the source image buffer (optional)
+dest_buffer = handle to the destination image buffer (optional)
+
+
+
+
Description
+
+
+
+Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.
+
+; CopyRect Example
+
+; Turn on graphics mode
+Graphics 800,600,16
+
+; create a blank image
+gfxBlank=CreateImage (300,300)
+
+; Fill the screen with random boxes in random colors
+For t = 1 To 1000
+Rect Rand(800),Rand(600),Rand(100),Rand(100),Rand(0,1)
+Color Rand(255),Rand(255),Rand(255)
+Next
+
+; Wait a couple of seconds so the user can see it
+Delay 2000
+
+; Copy graphics randomly from the front buffer to the blank image
+CopyRect Rand(800),Rand(600),300,300,0,0,FrontBuffer(),ImageBuffer(gfxBlank)
+
+; Clear the screen, draw the copied to image, wait for user to hit a key
+Cls
+DrawImage gfxBlank,0,0
+WaitKey
+
+
+
+
-; Turn on graphics mode
-Graphics 800,600,16
+Index
-; create a blank image
-gfxBlank=CreateImage (300,300)
-
-; Fill the screen with random boxes in random colors
-For t = 1 To 1000
-Rect Rand(800),Rand(600),Rand(100),Rand(100),Rand(0,1)
-Color Rand(255),Rand(255),Rand(255)
-Next
-
-; Wait a couple of seconds so the user can see it
-Delay 2000
-
-; Copy graphics randomly from the front buffer to the blank image
-CopyRect Rand(800),Rand(600),300,300,0,0,FrontBuffer(),ImageBuffer(gfxBlank)
-
-; Clear the screen, draw the copied to image, wait for user to hit a key
-Cls
-DrawImage gfxBlank,0,0
-WaitKey
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Cos.htm b/_release/help/commands/2d_commands/Cos.htm
index 9eb0c6b..b1867c8 100644
--- a/_release/help/commands/2d_commands/Cos.htm
+++ b/_release/help/commands/2d_commands/Cos.htm
@@ -1,26 +1,105 @@
-Command: Cos Cos (Number) Definition:
The Cos command is a trigonometry function, that returns a number between -1 and 1. This value represents the "X" coordinate of point x,y.
Parameter Description:
number=float or integer representing a value in degree
Command Description:
This command is used for translating angle values to coordinates, but there are a few things you have to take into account when doing it. First of all the Cos() command assumes the point you want is at radius 1 (pixel), next it uses a circle where 0 degrees is due EAST and increases in a counterclockwise direction, then you've got to take into account the the Y axis on a computer screen is up-side-down compared to a normal mathematical coordinate system.
+
+
+Blitz3D Docs
+
+
+
+
Cos# ( degrees# )
+
Parameters
+
+
+
+degrees# = angle in degrees.
+
+
+
+
Description
+
+
+
+For angles between 0 and 90 degrees this is defined by the sides of a right triangle. The cosine is the side adjacent to the angle divided by the hypotenuse.
+
+Outside of 0 to 90 the definition uses a circle with radius=1. The angle is placed at the center of the circle, with one side on the positive x-axis. The other side hits the circle at some point. The x coordinate of this point is the cosine of the angle.
+
+The positive y-axis corresonds to +90 degrees. This is a common source of confusion in Blitz. With screen coordinates ( pixels ) the y-axis points downward. But in the 3d world the y-axis typically points upward.
+
+Another possible snag is the size of the angle. In principle, the cosine function repeats every 360 degrees. So Cos(-360), Cos(0), Cos(360), Cos(720) etc. should all be exactly the same. But in practice the accuracy decreases as the angle gets farther away from zero.
+
+
+See also ASin, Cos, ACos, Tan, Atan, ATan2
+
Graphics 640,480; Change to graphics mode, nothing tricky yet.
-Origin 320,240 ; Move the point of orign for all drawing commands to the middle of the screen.
+Index
-For degrees=0 To 359; Step though all the degrees in a circle (360 in all)
-Delay(5); Wait 5 milli secsonds.
-
-; The next line calculates the Y coordinate of the point of the circle using the Sin
-; command, and multiplies it by 100 (to get a larger radius, try and change it).
-y=Sin(degrees)*100
-
-y=-y ; Invert Y coordinate to represent it properly on screen.
-
-; The next line calculates the X coordinate of the point of the circle using the Cos,
-; command, and multiplies it by 100 (to get a larger radius, try and change it).
-x=Cos(degrees)*100
-
-Rect x,y,1,1 ; Draw the current point on the circle.
-
-Next ; Give us another angle
-
-MouseWait ; Wait for the mouse.
-End ; Terminate the program.
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CountGFXModes.htm b/_release/help/commands/2d_commands/CountGFXModes.htm
index 821349e..e8764bb 100644
--- a/_release/help/commands/2d_commands/CountGFXModes.htm
+++ b/_release/help/commands/2d_commands/CountGFXModes.htm
@@ -1,14 +1,49 @@
-Command: CountGFXModes() CountGFXModes() Definition:
Returns the number of video graphic modes available.
Parameter Description:
None.
Command Description:
Use this command to return the number of video modes the user's video card can display in. Use the GFXModeWidth, GFXModeHeight, and GFXModeDepth with each number of video mode to determine the width, height, and color depth capabilities of each mode. See example.
+Use this command to return the number of video modes the user's video card can display in. Use the GFXModeWidth, GFXModeHeight, and GFXModeDepth with each number of video mode to determine the width, height, and color depth capabilities of each mode. See example.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CountGfxDrivers.htm b/_release/help/commands/2d_commands/CountGfxDrivers.htm
index 6b1bba4..207f7d5 100644
--- a/_release/help/commands/2d_commands/CountGfxDrivers.htm
+++ b/_release/help/commands/2d_commands/CountGfxDrivers.htm
@@ -1,22 +1,53 @@
-Command: CountGfxDrivers() CountGfxDrivers() Definition:
Returns the number of graphic drivers on the system.
Parameter Description:
None.
Command Description:
Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card).
+
+
+Blitz3D Docs
+
+
+
+
CountGfxDrivers()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card). Once you know how many drivers there are, you can iterate through them with GfxDriverName$ and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with SetGfxDriver. Normally, this won't be necessary with 2D programming.
+
+; GfxDriver Examples
+
+; Count how many drivers there are
+totalDrivers=CountGfxDrivers()
+Print "Choose a driver to use:"
+
+; Go through them all and print their names (most people will have only 1)
+For t = 1 To totalDrivers
+Print t+") " + GfxDriverName$(t)
+Next
+
+; Let the user choose one
+driver=Input("Enter Selection:")
+
+; Set the driver!
+SetGfxDriver driver
+Print "Your driver has been selected!"
-Once you know how many drivers there are, you can iterate through them with GfxDriverName$ and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with SetGfxDriver.
-
-Normally, this won't be necessary with 2D programming.
Example:
; GfxDriver Examples
+
+
+
-; Count how many drivers there are
-totalDrivers=CountGfxDrivers()
-Print "Choose a driver to use:"
+Index
-; Go through them all and print their names (most people will have only 1)
-For t = 1 To totalDrivers
-Print t+") " + GfxDriverName$(t)
-Next
-
-; Let the user choose one
-driver=Input("Enter Selection:")
-
-; Set the driver!
-SetGfxDriver driver
-Print "Your driver has been selected!"
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CreateBank.htm b/_release/help/commands/2d_commands/CreateBank.htm
index 20231ba..2b58ee4 100644
--- a/_release/help/commands/2d_commands/CreateBank.htm
+++ b/_release/help/commands/2d_commands/CreateBank.htm
@@ -1,22 +1,61 @@
-Command: CreateBank CreateBank (size) Definition:
Create a data bank.
Parameter Description:
size = size of memory bank in bytes
Command Description:
The bank commands allow you to make your own memory bank to perform your own read and write operations to. This is useful for compression/decompression, level data, and tons of other uses.
+
+
+Blitz3D Docs
+
+
+
+
CreateBank ([size])
+
Parameters
+
+
+
+size - size of memory bank in bytes (default is 0 bytes)
+
+
+
+
Description
+
+
+
+The bank commands allow you to perform high-speed data operations on a block of memory. This is useful for writing your own compression/decompression routines, passing and receiving data to and from a DLL and more. Banks start at 0 and finish at size-1.
+
+The data types available for use with a bank are:
+
+Byte - takes up one byte. Values can be in the range 0 to 255.
+Short - takes up two bytes. Values can be in the range 0 to 65535.
+Int - takes up four bytes. Values can be in the range -2147483647 to 2147483647.
+Float - takes up four bytes.
-This command allocates the memory and creates a handle to the bank.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CreateDir.htm b/_release/help/commands/2d_commands/CreateDir.htm
index dd8a4ca..5d28774 100644
--- a/_release/help/commands/2d_commands/CreateDir.htm
+++ b/_release/help/commands/2d_commands/CreateDir.htm
@@ -1,7 +1,40 @@
-Command: CreateDir CreateDir path/name Definition:
Creates a directory/folder on a storage device.
Parameter Description:
path/name = full path and name for new directory
Command Description:
Creates a directory (file folder) at the destination specified. Do not use a trailing slash at the end of the path/name parameter. You cannot be sure the directory was created with this command, so you will need to verify its existance yourself (use the FILETYPE command).
Example:
; CREATEDIR example
+
+
+Blitz3D Docs
+
+
+
+
CreateDir path/name
+
Parameters
+
+
+
+path/name = full path and name for new directory
+
+
+
+
Description
+
+
+
+Creates a directory (file folder) at the destination specified. Do not use a trailing slash at the end of the path/name parameter. You cannot be sure the directory was created with this command, so you will need to verify its existance yourself (use the FILETYPE command).
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CreateImage.htm b/_release/help/commands/2d_commands/CreateImage.htm
index ed3ea4b..bd9ec33 100644
--- a/_release/help/commands/2d_commands/CreateImage.htm
+++ b/_release/help/commands/2d_commands/CreateImage.htm
@@ -1,43 +1,77 @@
-Command: CreateImage CreateImage (width,height[,frames]) Definition:
Create a new image in memory and give its handle to a variable.
Parameter Description:
width=width of the new image (or its frames)
-height=height of the new image
-frames= optional number of frames (assumed to be a single frame)
Command Description:
Sometimes you want to create a completely new graphic on the fly (using other images, drawing commands, etc.) instead of loading one. This command will let you create a new image with a single frame or multiple frames for animation. You specify the width, height, and optional number of frames. The example should be pretty self-explainatory.
+width=width of the new image (or its frames)
+height=height of the new image
+frames= optional number of frames (assumed to be a single frame)
+
+
+
+
Description
+
+
+
+Sometimes you want to create a completely new graphic on the fly (using other images, drawing commands, etc.) instead of loading one. This command will let you create a new image with a single frame or multiple frames for animation. You specify the width, height, and optional number of frames. The example should be pretty self-explainatory.
+
+; CreateImage/TileImage/ImageBuffer example
+
+; Again, we'll use globals even tho we don't need them here
+; One variable for the graphic we'll create, one for a timer
+Global gfxStarfield, tmrScreen
+
+; Declare graphic mode
+Graphics 640,480,16
+
+; Create a blank image that is 32 pixels wide and 32 high with 10 frames of 32x32
+gfxStarfield=CreateImage(32,32,10)
+
+; loop through each frame of the graphic we just made
+For t = 0 To 9
+; Set the drawing buffer to the graphic frame so we can write on it
+SetBuffer ImageBuffer(gfxStarfield,t)
+; put 50 stars in the frame at random locations
+For y = 1 To 50
+Plot Rnd(32),Rnd(32)
+Next
+Next
+
+; Double buffer mode for smooth screen drawing
+SetBuffer BackBuffer()
+
+; Loop until ESC is pressed
+While Not KeyHit(1)
+
+; Only update the screen every 300 milliseconds. Change 300 for faster or
+; slower screen updates
+If MilliSecs() > tmrScreen+300 Then
+Cls ; clear the screen
+
+; Tile the screen with a random frame from our new graphic starting at
+; x=0 and y=0 location.
+TileImage gfxStarfield,0,0,Rnd(9)
+Flip ; Flip the screen into view
+tmrScreen=MilliSecs() ; reset the time
+End If
+Wend
+
+
+
-; Again, we'll use globals even tho we don't need them here
-; One variable for the graphic we'll create, one for a timer
-Global gfxStarfield, tmrScreen
+Index
-; Declare graphic mode
-Graphics 640,480,16
-
-; Create a blank image that is 320 pixels wide and 32 high with 10 frames of 32x32
-gfxStarfield=CreateImage(32,32,10)
-
-; loop through each frame of the graphic we just made
-For t = 0 To 9
-; Set the drawing buffer to the graphic frame so we can write on it
-SetBuffer ImageBuffer(gfxStarfield,t)
-; put 50 stars in the frame at random locations
-For y = 1 To 50
- Plot Rnd(32),Rnd(32)
-Next
-Next
-
-; Double buffer mode for smooth screen drawing
-SetBuffer BackBuffer()
-
-; Loop until ESC is pressed
-While Not KeyHit(1)
-
-; Only update the screen every 300 milliseconds. Change 300 for faster or
-; slower screen updates
-If MilliSecs() > tmrScreen+300 Then
-Cls ; clear the screen
-
-; Tile the screen with a random frame from our new graphic starting at
-; x=0 and y=0 location.
-TileImage gfxStarfield,0,0,Rnd(9)
-Flip ; Flip the screen into view
-tmrScreen=MilliSecs() ; reset the time
-End If
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CreateNetPlayer.htm b/_release/help/commands/2d_commands/CreateNetPlayer.htm
index e9b3b45..eada5fb 100644
--- a/_release/help/commands/2d_commands/CreateNetPlayer.htm
+++ b/_release/help/commands/2d_commands/CreateNetPlayer.htm
@@ -1,30 +1,63 @@
-Command: CreateNetPlayer CreateNetPlayer (name$) Definition:
Creates a new local player on the network game.
Parameter Description:
name$ = any valid string holding the player's name.
Command Description:
Creates a new local player. This also causes a special message to be sent to all remote machines (see NetMsgType). This returns an integer player number to be used in sending/receiving messages. Note that you must create at least one player before you can send and receive messages.
+name$ = any valid string holding the player's name.
+
+
+
+
Description
+
+
+
+Creates a new local player. This also causes a special message to be sent to all remote machines (see NetMsgType). This returns an integer player number to be used in sending/receiving messages. Note that you must create at least one player before you can send and receive messages.
+
+; CreateNetPlayer example
+
+newGame = StartNetGame()
+; Check the status of the new game.
+If newGame = 0 Then
+Print "Could not start or join net game."
+End
+
+ElseIf newGame = 1
+Print "Successfully joined the network game"
+ElseIf newGame = 2
+Print "A new network game was started!"
+EndIf
+
+; Create a random player name
+name$="Player" + Rand(100)
+
+; Get a unique player id number for the player
+; and create the player
+playerID=CreateNetPlayer(name$)
+
+If playerID = 0 Then
+Print "Player could not be created!"
+Else
+Print "Player " + name$ + " was created and given ID#" + playerID
+End If
+WaitKey()
+
+
+
+
-newGame = StartNetGame()
-; Check the status of the new game.
-If newGame = 0 Then
- Print "Could not start or join net game."
- End
-
-ElseIf newGame = 1
- Print "Successfully joined the network game"
-ElseIf newGame = 2
- Print "A new network game was started!"
-EndIf
+Index
-; Create a random player name
-name$="Player" + Rand(100)
-
-; Get a unique player id number for the player
-; and create the player
-playerID=CreateNetPlayer(name$)
-
-If playerID = 0 Then
-Print "Player could not be created!"
-Else
-Print "Player " + name$ + " was created and given ID#" +
-playerID
-End If
-WaitKey()
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CreateTCPServer.htm b/_release/help/commands/2d_commands/CreateTCPServer.htm
index 143d45e..d636f77 100644
--- a/_release/help/commands/2d_commands/CreateTCPServer.htm
+++ b/_release/help/commands/2d_commands/CreateTCPServer.htm
@@ -1,57 +1,91 @@
-Command: CreateTCPServer CreateTCPServer (port) Definition:
Creates a TCP server on the specified port.
Parameter Description:
port = the port to use when creating the server
Command Description:
Creates a TCP/IP server with the designated port. Use this for communications between other clients and the local box. See OpenTCPStream, CloseTCPServer, and CloseTCPStream for more information.
+
+
+Blitz3D Docs
+
+
+
+
CreateTCPServer (port)
+
Parameters
+
+
+
+port = the port to use when creating the server
+
+
+
+
Description
+
+
+
+Creates a TCP/IP server with the designated port. Use this for communications between other clients and the local box. See OpenTCPStream, CloseTCPServer, and CloseTCPStream for more information.
+
+Returns a TCP/IP server handle if successful or 0 if not.
+
+; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example
+; This code is in two parts, and needs to be run seperately on the same machine
+
+; --- Start first code set ---
+; Create a server and listen for push
+
+svrGame=CreateTCPServer(8080)
+
+If svrGame<>0 Then
+Print "Server started successfully."
+Else
+Print "Server failed to start."
+End
+End If
+
+While Not KeyHit(1)
+strStream=AcceptTCPStream(svrGame)
+If strStream Then
+Print ReadString$(strStream)
+Delay 2000
+End
+Else
+Print "No word from Apollo X yet ..."
+Delay 1000
+End If
+Wend
+
+End
+
+; --- End first code set ---
+
+
+; --- Start second code set ---
+; Copy this code to another instance of Blitz Basic
+; Run the above code first, then run this ... they will 'talk'
+
+; Create a Client and push data
+
+strmGame=OpenTCPStream("127.0.0.1",8080)
+
+If strmGame<>0 Then
+Print "Client Connected successfully."
+Else
+Print "Server failed to connect."
+WaitKey
+End
+End If
+
+; write stream to server
+WriteString strmGame,"Mission Control, this is Apollo X ..."
+Print "Completed sending message to Mission control..."
+
+; --- End second code set ---
+
+
+
+
-Returns a TCP/IP server handle if successful or 0 if not.
Example:
; CreateTCPServer, CloseTCPServer, AcceptTCPStream Example
-; This code is in two parts, and needs to be run seperately on the same machine
+Index
-; --- Start first code set ---
-; Create a server and listen for push
-
-svrGame=CreateTCPServer(8080)
-
-If svrGame<>0 Then
-Print "Server started successfully."
-Else
-Print "Server failed to start."
-End
-End If
-
-While Not KeyHit(1)
-strStream=AcceptTCPStream(svrGame)
-If strStream Then
-Print ReadString$(strStream)
-Delay 2000
-End
-Else
-Print "No word from Apollo X yet ..."
-Delay 1000
-End If
-Wend
-
-End
-
-; --- End first code set ---
-
-
-; --- Start second code set ---
-; Copy this code to another instance of Blitz Basic
-; Run the above code first, then run this ... they will 'talk'
-
-; Create a Client and push data
-
-strmGame=OpenTCPStream("127.0.0.1",8080)
-
-If strmGame<>0 Then
-Print "Client Connected successfully."
-Else
-Print "Server failed to connect."
-WaitKey
-End
-End If
-
-; write stream to server
-WriteString strmGame,"Mission Control, this is Apollo X ..."
-Print "Completed sending message to Mission control..."
-
-; --- End second code set ---
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CreateTimer.htm b/_release/help/commands/2d_commands/CreateTimer.htm
index b8abf1c..9be757f 100644
--- a/_release/help/commands/2d_commands/CreateTimer.htm
+++ b/_release/help/commands/2d_commands/CreateTimer.htm
@@ -1,2 +1,46 @@
-Command: CreateTimer CreateTimer (frequency) Definition:
Creates a timer to track a frequency.
Parameter Description:
frequency = usually a framerate like 50 or 60
Command Description:
Use this command in conjunction with the WaitTimer command to control the speed of program execution (fps). You will use this in your main screen redraw loop to control the playback speed to match the proper speed. This will prevent your games from playing back too fast on computers faster than yours. Use of this system is VERY GOOD practice, as your game will be played on a variety of computers.
Example:
; Create the timer to track speed frameTimer=CreateTimer(60)
; Your main screen draw loop While Not KeyHit(1) WaitTimer(frameTimer) ; Pause until the timer reaches 60 Cls ; Draw your screen stuff Flip Wend
+Use this command in conjunction with the WaitTimer command to control the speed of program execution (fps). You will use this in your main screen redraw loop to control the playback speed to match the proper speed. This will prevent your games from playing back too fast on computers faster than yours. Use of this system is VERY GOOD practice, as your game will be played on a variety of computers.
+
+; Create the timer to track speed
+frameTimer=CreateTimer(60)
+
+; Your main screen draw loop
+While Not KeyHit(1)
+WaitTimer(frameTimer) ; Pause until the timer reaches 60
+Cls
+; Draw your screen stuff
+Flip
+Wend
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CurrentDate.htm b/_release/help/commands/2d_commands/CurrentDate.htm
index 9b0f3f0..c5940a9 100644
--- a/_release/help/commands/2d_commands/CurrentDate.htm
+++ b/_release/help/commands/2d_commands/CurrentDate.htm
@@ -1,5 +1,39 @@
-Command: CurrentDate$() CurrentDate$() Definition:
Returns the current system date.
Parameter Description:
None
Command Description:
Returns the current date in the format: DD MON YYYY (i.e. 10 DEC 2000).
Example:
; Print the current date to the screen
+
+
+Blitz3D Docs
+
+
+
+
CurrentDate$()
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+Returns the current date in the format: DD MON YYYY (i.e. 10 DEC 2000).
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CurrentDir.htm b/_release/help/commands/2d_commands/CurrentDir.htm
index db67942..6db38b5 100644
--- a/_release/help/commands/2d_commands/CurrentDir.htm
+++ b/_release/help/commands/2d_commands/CurrentDir.htm
@@ -1,7 +1,41 @@
-Command: CurrentDir$() CurrentDir$() Definition:
Returns a string containing the currently selected directory.
Parameter Description:
None.
Command Description:
This command will return the currently selected directory for disk operations, useful for advanced file operations. Use CHANGEDIR to change the current directory. The value returned doesn't have a trailing slash - aside from the root directory of the drive.
Example:
; CurrentDir$() example
+
+
+Blitz3D Docs
+
+
+
+
CurrentDir$()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+This command will return the currently selected directory for disk operations, useful for advanced file operations. Use CHANGEDIR to change the current directory. The value returned doesn't have a trailing slash - aside from the root directory of the drive.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/CurrentTime.htm b/_release/help/commands/2d_commands/CurrentTime.htm
index 411e832..0ad6384 100644
--- a/_release/help/commands/2d_commands/CurrentTime.htm
+++ b/_release/help/commands/2d_commands/CurrentTime.htm
@@ -1,5 +1,39 @@
-Command: CurrentTime$() CurrentTime$() Definition:
Returns the current system time.
Parameter Description:
None
Command Description:
Returns the current time in the format: HH:MM:SS (i.e. 14:31:57).
Example:
; Print the current time to the screen
+
+
+Blitz3D Docs
+
+
+
+
CurrentTime$()
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+Returns the current time in the format: HH:MM:SS (i.e. 14:31:57).
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Data.htm b/_release/help/commands/2d_commands/Data.htm
index ab73274..70bf2cf 100644
--- a/_release/help/commands/2d_commands/Data.htm
+++ b/_release/help/commands/2d_commands/Data.htm
@@ -1,28 +1,64 @@
-Command: Data Data list_of_values Definition:
Creates a list of constant values to be parsed through within your program
Parameter Description:
list_of_values = a list of comma delimited values (strings must be inside quotes)
Command Description:
Data is used to create neat, comma delimited lists of values of a constant nature that you will be reading (and probably reusing) during the execution of your game. You may store level information (number of enemies, stars, etc) there or just about anything you can think of! You can easily mix datatypes (strings, integers, floats) in your Data statements, as long as they are read properly with the Read command later. You will need to use the Restore command to point to the .Label that begins your Data statements. See the related commands for more information and more examples.
Example:
Print "Here we go!"
+
+
+Blitz3D Docs
+
+
+
+
Data list_of_values
+
Parameters
+
+
+
+list_of_values = a list of comma delimited values (strings must be inside quotes)
+
+
+
+
Description
+
+
+
+Data is used to create neat, comma delimited lists of values of a constant nature that you will be reading (and probably reusing) during the execution of your game. You may store level information (number of enemies, stars, etc) there or just about anything you can think of! You can easily mix datatypes (strings, integers, floats) in your Data statements, as long as they are read properly with the Read command later. You will need to use the Restore command to point to the .Label that begins your Data statements. See the related commands for more information and more examples.
-; Restore to the start of the Data statements
-Restore startData
-; Get the first number which is the total number of users
-Read Users
+See also: Read, Restore.
+
+Print "Here we go!"
+
+; Restore to the start of the Data statements
+Restore startData
+
+; Get the first number which is the total number of users
+Read Users
+
+; Print them all!
+For T = 1 To Users
+Read firstname$
+Read age
+Read accuracy#
+Read lastname$
+Print firstname$ + " " + lastname$ + " is " + age + " years old with " + accuracy# + " accuracy!"
+Next
+
+While Not KeyHit(1)
+Wend
+End
+
+.startData
+Data 3
+Data "Shane", 31, 33.3333, "Monroe"
+Data "Bob", 28, 12.25, "Smith"
+Data "Roger", 54, 66.66, "Rabbit"
+
+
+
-; Print them all!
-For T = 1 To Users
- Read firstname$
- Read age
- Read accuracy#
- Read lastname$
- Print firstname$ + " " + lastname$ + " is " + age + " years old with " + accuracy# + " accuracy!"
-Next
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DebugLog.htm b/_release/help/commands/2d_commands/DebugLog.htm
index 450fadd..c29db9d 100644
--- a/_release/help/commands/2d_commands/DebugLog.htm
+++ b/_release/help/commands/2d_commands/DebugLog.htm
@@ -1,18 +1,56 @@
-Command: DebugLog DebugLog message Definition:
Writes a message to the debug log for debugging purposes.
Parameter Description:
message = message text string value
Command Description:
You power programmers will just love this. You have your own debug log to write to!
+
+
+Blitz3D Docs
+
+
+
+
DebugLog message
+
Parameters
+
+
+
+message = message text string value
+
+
+
+
Description
+
+
+
+You power programmers will just love this. You have your own debug log to write to! The DebugLog can be viewed from the debugger window during program execution only.
+
+
+For those not familiar to this sort of thing, think of the Debug log like your own private 'in program notepad'. Use this to write messages to yourself during program execution. For example, you could write the graphic modes that the user has on his system, or just little alerts to let you know your code execution made it to a certain point in the execution without interrupting it. I'm sure you'll find a lot of uses for this! See the example if you're still lost.
-For those not familiar to this sort of thing, think of the Debug log like your own private 'in program notepad'. Use this to write messages to yourself during program execution. For example, you could write the graphic modes that the user has on his system, or just little alerts to let you know your code execution made it to a certain point in the execution without interrupting it. I'm sure you'll find a lot of uses for this! See the example if you're still lost.
+; DebugLog Example
+
+; Let's start graphics mode
+Graphics 640,480,16
+
+; Now, let's load an image that doesn't exist!
+gfxPlayer=LoadImage("noimagefound.jpg")
+If gfxPlayer=0 Then
+DebugLog "Player's Graphics failed to load!"
+End If
+
+; This is supposed to generate an error. Press F9 to see the log!
+While Not KeyHit(1)
+DrawImage gfxPlayer,100,100
+Wend
+
+
+
-; Now, let's load an image that doesn't exist!
-gfxPlayer=LoadImage("noimagefound.jpg")
-If gfxPlayer=0 Then
-DebugLog "Player's Graphics failed to load!"
-End If
+Index
-; This is supposed to generate an error. Press F9 to see the log!
-While Not KeyHit(1)
-DrawImage gfxPlayer,100,100
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Default.htm b/_release/help/commands/2d_commands/Default.htm
index 435b4d5..d5b7d93 100644
--- a/_release/help/commands/2d_commands/Default.htm
+++ b/_release/help/commands/2d_commands/Default.htm
@@ -1,27 +1,63 @@
-Command: Default Default Definition:
Specifies the set of commands that executes in a Select structure if none of the CASEs are met.
Parameter Description:
None.
Command Description:
In a SELECT structure, you may wish to execute code if none of the cases you specify are met. All code after DEFAULT to END SELECT will be executed if no case is met. See SELECT, CASE, and the example for more.
Example:
; SELECT/CASE/DEFAULT/END SELECT Example
-; Assign a random number 1-10
-mission=Rnd(1,10)
+
+
+Blitz3D Docs
+
+
+
+
Default
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+In a SELECT structure, you may wish to execute code if none of the cases you specify are met. All code after DEFAULT to END SELECT will be executed if no case is met. See SELECT, CASE, and the example for more.
-; Start the selection process based on the value of 'mission' variable
-Select mission
-; Is mission = 1?
-Case 1
-Print "Your mission is to get the plutonium and get out alive!"
+See also: Select, Case, End Select.
+
+; SELECT/CASE/DEFAULT/END SELECT Example
+; Assign a random number 1-10
+mission=Rnd(1,10)
+
+; Start the selection process based on the value of 'mission' variable
+Select mission
+
+; Is mission = 1?
+Case 1
+Print "Your mission is to get the plutonium and get out alive!"
+
+; Is mission = 2?
+Case 2
+Print "Your mission is to destroy all enemies!"
+
+; Is mission = 3?
+Case 3
+Print "Your mission is to steal the enemy building plans!"
+
+; What do do if none of the cases match the value of mission
+Default
+Print "Missions 4-10 are not available yet!"
+
+; End the selection process
+End Select
+
+
+
-; Is mission = 2?
-Case 2
-Print "Your mission is to destroy all enemies!"
+Index
-; Is mission = 3?
-Case 3
-Print "Your mission is to steal the enemy building plans!"
-
-; What do do if none of the cases match the value of mission
-Default
-Print "Missions 4-10 are not available yet!"
-
-; End the selection process
-End Select
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Delay.htm b/_release/help/commands/2d_commands/Delay.htm
index 985146f..54fb0d2 100644
--- a/_release/help/commands/2d_commands/Delay.htm
+++ b/_release/help/commands/2d_commands/Delay.htm
@@ -1,5 +1,39 @@
-Command: Delay Delay milliseconds Definition:
Pause program execution for a certain time.
Parameter Description:
milliseconds = the amount of milliseconds to delay. 1000=1 second
Command Description:
This command stops all program execution for the designated time period. All execution stops. If you need program execution to continue, consider trapping time elapsed with a custom timer function using Millisecs().
Example:
; Delay for 5 seconds
+
+
+Blitz3D Docs
+
+
+
+
Delay milliseconds
+
Parameters
+
+
+
+milliseconds = the amount of milliseconds to delay. 1000=1 second
+
+
+
+
Description
+
+
+
+This command stops all program execution for the designated time period. All execution stops. If you need program execution to continue, consider trapping time elapsed with a custom timer function using Millisecs().
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Delete.htm b/_release/help/commands/2d_commands/Delete.htm
index f0b3801..fe68752 100644
--- a/_release/help/commands/2d_commands/Delete.htm
+++ b/_release/help/commands/2d_commands/Delete.htm
@@ -1,15 +1,51 @@
-Command: Delete Delete custom_type_name Definition:
Delete an object from a custom TYPE collection.
Parameter Description:
custom_type_name = the custom name of an existing object
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
Use the Delete command to remove an object from the Type collection. Use the
- commands FIRST, LAST, BEFORE, and NEXT to move the object pointer to the object
- you want to delete, then issue the Delete command with the custom Type name.
-
This is often used in a FOR ... EACH loop when a collision happens and you
- wish to remove the object (an alien ship object for example) from the collection.
Example:
; Move them all over 1 (like the description example from TYPE command)
- ; If the chair isn't on the screen anymore, delete that chair object from the
- ; collection.
-
For room.chair = Each chair
- room\x = room\x + 1
- if room\x > 640 then
- Delete room
- Next
+custom_type_name = the custom name of an existing object
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+Use the Delete command to remove an object from the Type collection. Use the commands FIRST, LAST, BEFORE, and NEXT to move the object pointer to the object you want to delete, then issue the Delete command with the custom Type name. If you wish to delete all objects of a certain type, you can use DELETE EACH .
+
+This is often used in a FOR ... EACH loop when a collision happens and you wish to remove the object (an alien ship object for example) from the collection.
+
+
+See also: Type, New, Before, After, First, Last, Each, Insert.
+
+; Move them all over 1 (like the description example from TYPE command)
+; If the chair isn't on the screen anymore, delete that chair object from the
+; collection.
+
+For room.chair = Each chair
+room\x = room\x + 1
+if room\x > 640 then
+Delete room
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DeleteDir.htm b/_release/help/commands/2d_commands/DeleteDir.htm
index ac98d85..edb0f0d 100644
--- a/_release/help/commands/2d_commands/DeleteDir.htm
+++ b/_release/help/commands/2d_commands/DeleteDir.htm
@@ -1,5 +1,38 @@
-Command: DeleteDir DeleteDir directory/path Definition:
Deletes a specified folder/directory.
Parameter Description:
directory/path = full path/name of directory
Command Description:
Deletes a specified folder/directory from the device. Note: This only works on EMPTY directories - you cannot delete a folder with other folders or files inside with this command. Do not apply a trailing slash.
Example:
; DeleteDir example
+
+
+Blitz3D Docs
+
+
+
+
DeleteDir directory/path
+
Parameters
+
+
+
+directory/path = full path/name of directory
+
+
+
+
Description
+
+
+
+Deletes a specified folder/directory from the device. Note: This only works on EMPTY directories - you cannot delete a folder with other folders or files inside with this command. Do not apply a trailing slash.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DeleteFile.htm b/_release/help/commands/2d_commands/DeleteFile.htm
index e0af252..eca5c37 100644
--- a/_release/help/commands/2d_commands/DeleteFile.htm
+++ b/_release/help/commands/2d_commands/DeleteFile.htm
@@ -1,4 +1,38 @@
-Command: DeleteFile DeleteFile path/filename Definition:
Deletes a specified file.
Parameter Description:
path/filename = full path/filename to the file to delete
Command Description:
Deletes a specified file from the drive. You will need to make sure the file exists before execution and be sure its been deleted AFTER execution. Use FILETYPE to determine this.
Example:
; DELETEFILE example
+
+
+Blitz3D Docs
+
+
+
+
DeleteFile path/filename
+
Parameters
+
+
+
+path/filename = full path/filename to the file to delete
+
+
+
+
Description
+
+
+
+Deletes a specified file from the drive. You will need to make sure the file exists before execution and be sure its been deleted AFTER execution. Use FILETYPE to determine this.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DeleteNetPlayer.htm b/_release/help/commands/2d_commands/DeleteNetPlayer.htm
index 36d6954..3dc5559 100644
--- a/_release/help/commands/2d_commands/DeleteNetPlayer.htm
+++ b/_release/help/commands/2d_commands/DeleteNetPlayer.htm
@@ -1,34 +1,68 @@
-Command: DeleteNetPlayer DeleteNetPlayer playerID Definition:
Deletes a local player from the network game.
Parameter Description:
playerID = value assigned when player was created with CreateNetPlayer
Command Description:
Using the playerID generated by the CreateNetPlayer command, this command will remove the designated player from the network game.
+
+
+Blitz3D Docs
+
+
+
+
DeleteNetPlayer playerID
+
Parameters
+
+
+
+playerID = value assigned when player was created with CreateNetPlayer
+
+
+
+
Description
+
+
+
+Using the playerID generated by the CreateNetPlayer command, this command will remove the designated player from the network game.
+
+This also causes a special message to be sent to all remote machines (see NetMsgType).
+
+; DeleteNetPlayer example
+
+newGame = StartNetGame()
+; Check the status of the new game. If newGame = 0 Then
+Print "Could not start or join net game."
+End
+
+ElseIf newGame = 1
+Print "Successfully joined the network game"
+ElseIf newGame = 2
+Print "A new network game was started!"
+EndIf
+
+; Create a random player name
+name$="Player" + Rand(100)
+
+; Get a unique player id number for the player
+; and create the player
+playerID=CreateNetPlayer(name$)
+
+If playerID = 0 Then
+Print "Player could not be created!"
+Else
+Print "Player " + name$ + " was created and given ID#" + playerID
+WaitKey()
+; delete the player!
+DeleteNetPlayer playerID
+Print "The local player was deleted!"
+End If
+waitkey()
+
+
+
+
-This also causes a special message to be sent to all remote machines (see NetMsgType).
-newGame = StartNetGame()
-; Check the status of the new game.
-If newGame = 0 Then
- Print "Could not start or join net game."
- End
-
-ElseIf newGame = 1
- Print "Successfully joined the network game"
-ElseIf newGame = 2
- Print "A new network game was started!"
-EndIf
-
-; Create a random player name
-name$="Player" + Rand(100)
-
-; Get a unique player id number for the player
-; and create the player
-playerID=CreateNetPlayer(name$)
-
-If playerID = 0 Then
-Print "Player could not be created!"
-Else
-Print "Player " + name$ + " was created and given ID#" + playerID
-WaitKey()
-; delete the player!
-DeleteNetPlayer playerID
-Print "The local player was deleted!"
-End If
-waitkey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Dim.htm b/_release/help/commands/2d_commands/Dim.htm
index 2e63cd9..e8eceed 100644
--- a/_release/help/commands/2d_commands/Dim.htm
+++ b/_release/help/commands/2d_commands/Dim.htm
@@ -1,27 +1,77 @@
-Command: Dim Dim variable(elements) Definition:
Dimensions an array variable for storage.
Parameter Description:
variable = variable of desired type (string, floating, integer)
-elements = number of elements to be created. Can be multi-dimensional.
Command Description:
Prepares an array using the specified variable type as its type and specified elements for the number of containers it should hold. You may use as many dimension elements as you like (just watch your memory). There is no way in Blitz to 'Redimension' arrays, so define them accordingly. Use the proper notation on the declaration variable to make it a string($), floating(#), or integer type array. Note: Arrays always start at ZERO reference - so variable(0) is always the first element.
+
+
+Blitz3D Docs
+
+
+
+
Dim array_name(index1[,index2][,index3][,...])
+
Parameters
+
+
+
+array_name - array name
+index1 - index number of last variable to be created within that particular index-range
+index2 (optional) - index number of last variable to be created within that particular index-range
+index3 (optional) - index number of last variable to be created within that particular index-range
+... (optional) - and so on
+
+
+
+
Description
+
+
+
+Creates an array of the specified type. For example, Dim tiles(10) creates an integer array, Dim tiles#(10) creates a float array and Dim tile$(10) creates a string array.
+
+
+The contents of an array can be accessed using the index notation: 0 - indexn, giving indexn+1 number of elements for that particular index range. You should not attempt to access a non-existent element of the array. In debug mode this will cause an error stating 'index out of bounds'. With debug off however, you may get 'illegal memory access' errors, or worse no immediate errors at all.
+
+Arrays are global, and must be defined in the main program.
+
+Arrays can be re-dimmed by using the Dim statement again with the same array name, but the contents of the array will be lost.
+
+-----------------------------------------------------------
+
+*NEW* BLITZ ARRAYS *NEW*
+
+Since a recent Blitz update you can now do what are called 'blitz arrays'. These are very different to a Dim'd array, in the following ways:
+
+They use square brackets [] instead of the normal round ones ().
+
+You declare them like you do Local or Global variables, example: Local myArray[10]
+
+They cannot be multi-dimensional, and cannot be resized.
+
+They can be stored in Type objects.
+
+They can be passed to functions.
+
+-----------------------------------------------------------
-To use this command effectively, you must understand arrays. Think of an array like a variable that has multiple slots to hold many values, all under the same variable name. Before TYPEs came around, this was the best way to track repeating elements (say, alien ships) because you can iterate through an array collection easily.
-Take for example, you want to track 100 aliens on the screen. You could have two variables - alienx and alieny. By making these arrays - alienx() and alieny() and each having 100 elements each, you could easily set or retrieve the first alien's location by using alienx(1), alieny(1). The next alien's coordinates would be alienx(2), alienx(2) and so on. This makes it easy to use a FOR ... NEXT or EACH loop to go through all the elements.
+See also: Global, Local.
+
+; Dim Example
+; Create a collection of 100 random numbers
+
+; Create array
+Dim nums(99)
+
+; Fill each element with a random number
+For i = 0 to 99
+nums(i) = Rand(1,1000)
+Next
+
+
+
-Arrays are also useful for 'multi-dimensional' notation too. Instead of tracking our 100 aliens in the method mentioned above, you could use a single variable: alien(100,1). The first element collection are the 100 aliens, the second element is the X and Y location of that alien - the 0 element being the alien's X location, and the 1 element being the alien's Y location. So to set the position of alien 57 to X=640,Y=480 you could do this:
+Index
-alien(57,0)=640
-alien(57,1)=480
-DrawImage imgAlien,alien(57,0),alien(57,1)
-
-Of course, TYPEs are a much better way of doing this sort of multiple value sort of routine.
-
-Arrays are great for tracking collections of items with a single, common element - but often times TYPEs will prove to be more useful.
Example:
; DIM example
-; Create a collection of 100 random numbers
-
-; Declare our array
-Dim nums(100)
-
-; Fill each element with a random number
-For T = 1 to 100
-nums(t) = Rnd(1,100)
-Next
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DrawBlock.htm b/_release/help/commands/2d_commands/DrawBlock.htm
index 9678678..9813ac8 100644
--- a/_release/help/commands/2d_commands/DrawBlock.htm
+++ b/_release/help/commands/2d_commands/DrawBlock.htm
@@ -1,31 +1,67 @@
-Command: DrawBlock DrawBlock image,x,y,[frame] Definition:
Draws an image at a location without regards to transparency.
Parameter Description:
image = variable of the image handle
-x = x location to draw the image
-y = y location to draw the image
-frame = image's frame to draw (optional - default is 0)
Command Description:
This is similar to the DrawImage command except that any transparency or MaskImage is ignored and the entire image (including masked colors) is drawn. The frame is optional.
Example:
; DrawBlock Example
+
+
+Blitz3D Docs
+
+
+
+
DrawBlock image, x,y [,frame]
+
Parameters
+
+
+
+image = variable of the image pointer
+x = x location to draw the image
+y = y location to draw the image
+frame = image's frame to draw (optional - default is 0)
+
+
+
+
Description
+
+
+
+This is similar to the DrawImage command except that any transparency or MaskImage is ignored and the entire image (including masked colors) is drawn. The frame is optional.
+
+See also: DrawImage
+
+; DrawBlock Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create new empty graphic to store our circle in
+gfxCircle=CreateImage(50,50)
+
+; Draw the circle image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+
+; Let's not forget to put the drawing buffer back!
+SetBuffer BackBuffer()
+; Set the CLS color to white
+ClsColor 255,255,255
+
+; Let the user move the circle graphic around a white screen
+; putting the graphic at the MouseX,Y coordinates
+While Not KeyHit(1)
+Cls
+DrawBlock gfxCircle,MouseX(),MouseY()
+Flip
+Wend
+
+
+
-; Turn on graphics mode
-Graphics 640,480,16
+Index
-; Create new empty graphic to store our circle in
-gfxCircle=CreateImage(50,50)
-
-; Draw the circle image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-
-; Let's not forget to put the drawing buffer back!
-SetBuffer BackBuffer()
-; Set the CLS color to white
-ClsColor 255,255,255
-
-; Let the user move the circle graphic around a white screen
-; putting the graphic at the MouseX,Y coordinates
-While Not KeyHit(1)
-Cls
-DrawBlock gfxCircle,MouseX(),MouseY()
-Flip
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DrawBlockRect.htm b/_release/help/commands/2d_commands/DrawBlockRect.htm
index 25ccbac..b6aab94 100644
--- a/_release/help/commands/2d_commands/DrawBlockRect.htm
+++ b/_release/help/commands/2d_commands/DrawBlockRect.htm
@@ -1,38 +1,72 @@
-Command: DrawBlockRect DrawBlockRect image,x,y,rect_x,rect_y,rect_width,rect_height,[frame] Definition:
Draws a rectangular area of an image at the designated location without transparency.
Parameter Description:
image = variable holding the image handle
-x = x location on the screen to draw the image
-y = y location on the screen to draw the image
-rect_x = starting x location within the image to draw
-rect_y = starting y location within the image to draw
-rect_width = the height of the area to draw
-rect_height = the width of the area to draw
-frame = optional frame number of image to draw
-
Command Description:
This command will let you draw a rectangular PORTION of an image to the designated location on the screen. The transparent/masked portions of the original image will be ignored and drawn with the image.
+
+
+Blitz3D Docs
+
+
+
+
+image = variable holding the image handle
+x = x location on the screen to draw the image
+y = y location on the screen to draw the image
+rect_x = starting x location within the image to draw
+rect_y = starting y location within the image to draw
+rect_width = the height of the area to draw
+rect_height = the width of the area to draw
+frame = optional frame number of image to draw
+
+
+
+
Description
+
+
+
+This command will let you draw a rectangular PORTION of an image to the designated location on the screen. The transparent/masked portions of the original image will be ignored and drawn with the image.
+
+This is handy if you are doing something like revealing part of a screen when the player uncovers something (think QIX). You could load the 'picture' into an image, then when the player clears a rectangular region, you could paste that portion of the final image onto the playfield. If you want to draw the image portion with transparency or masking, use DrawImageRect instead.
+
+; DrawBlockRect Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create new empty graphic to store our circle in
+gfxCircle=CreateImage(50,50)
+
+; Draw the circle image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+SetBuffer FrontBuffer()
+
+; Set the screen to white so you can see the transparent areas
+ClsColor 255,255,255
+Cls
+
+; Let's draw portions of the circle randomly
+While Not KeyHit(1)
+; We take random sized portions of the circle and put them
+; at a random location ... wash, rinse, and repeat
+DrawBlockRect gfxCircle,Rnd(640),Rnd(480),0,0,Rnd(50),Rnd(50),0
+Delay 100
+Wend
+
+
+
+
-This is handy if you are doing something like revealing part of a screen when the player uncovers something (think QIX). You could load the 'picture' into an image, then when the player clears a rectangular region, you could paste that portion of the final image onto the playfield. If you want to draw the image portion with transparency or masking, use DrawImageRect instead.
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Create new empty graphic to store our circle in
-gfxCircle=CreateImage(50,50)
-
-; Draw the circle image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-SetBuffer FrontBuffer()
-
-; Set the screen to white so you can see the transparent areas
-ClsColor 255,255,255
-Cls
-
-; Let's draw portions of the circle randomly
-While Not KeyHit(1)
-; We take random sized portions of the circle and put them
-; at a random location ... wash, rinse, and repeat
-DrawBlockRect gfxCircle,Rnd(640),Rnd(480),0,0,Rnd(50),Rnd(50),0
-Delay 100
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DrawImage.htm b/_release/help/commands/2d_commands/DrawImage.htm
index 35e0248..0114e6e 100644
--- a/_release/help/commands/2d_commands/DrawImage.htm
+++ b/_release/help/commands/2d_commands/DrawImage.htm
@@ -1,35 +1,71 @@
-Command: DrawImage DrawImage handle,x,y,[frame] Definition:
Draws an image or frame of an animImage on the screen.
Parameter Description:
handle = variable image handle previously designated
-x = the 'x' location of the screen to display the graphic
-y = the 'y' location of the screen to display the graphic
-frame = the frame number of the AnimImage to display (optional; 0 is assumed)
Command Description:
This command draws a previously loaded graphic. This command draws both single image graphics (loaded with the LoadImage command) as well as animated images (loaded with the LoadAnimImage command).
+
+
+Blitz3D Docs
+
+
+
+
DrawImage image, x,y [,frame]
+
Parameters
+
+
+
+image = variable image pointer previously designated
+x = the 'x' location of the screen to display the graphic
+y = the 'y' location of the screen to display the graphic
+frame = the frame number of the AnimImage to display (optional: default is 0)
+
+
+
+
Description
+
+
+
+This command draws a previously loaded image. This command draws both single image graphics (loaded with the LoadImage command) as well as animated images (loaded with the LoadAnimImage command).
+
+You specify where on the screen you wish the image to appear. You can actually 'draw' off the screen as well by using negative values or positive values that are not visible 'on the screen'.
+
+Finally, if you are using an animated image (loaded with the LoadAnimImage), you can specify which frame of the imagestrip is displayed with the DrawImage command.
+
+One of the most common problems new Blitz programmers face when using drawing commands is that even though they draw the graphic to the screen, they never see it!
+
+Remember, Blitz Basic is fast ... too fast for the human eye. You will have to either continuously draw the image over and over again (like the way a cartoon or TV works), clearing the screen each time a change is made (this is called double buffering); or you will need to delay Blitz's execution long enough in 'human time' to let you SEE the picture. We will do the double buffering approach.
+
+See also: DrawBlock
+
+; LoadImage and DrawImage example
+
+; Declare a variable to hold the graphic file handle
+Global gfxPlayer
+
+; Set a graphics mode
+Graphics 640,480,16
+
+; Set drawing operations for double buffering
+SetBuffer BackBuffer()
+
+; Load the image and assign its file handle to the variable
+; - This assumes you have a graphic called player.bmp in the
+; same folder as this source code
+gfxPlayer=LoadImage("player.bmp")
+
+; Let's do a loop where the graphic is drawn wherever the
+; mouse is pointing. ESC will exit.
+While Not KeyHit(1)
+Cls ; clear the screen
+DrawImage gfxPlayer,MouseX(),MouseY() ; Draw the image!
+Flip ; flip the image into view and clear the back buffer
+Wend
+
+
+
-You specify where on the screen you wish the image to appear. You can actually 'draw' off the screen as well by using negative values or positive values that are not visible 'on the screen'.
+Index
-Finally, if you are using an animated image (loaded with the LoadAnimImage), you can specify which frame of the imagestrip is displayed with the DrawImage command.
-
-One of the most common problems new Blitz programmers face when using drawing commands is that even though they draw the graphic to the screen, they never see it!
-
-Remember, Blitz Basic is fast ... too fast for the human eye. You will have to either continuously draw the image over and over again (like the way a cartoon or TV works), clearing the screen each time a change is made (this is called double buffering); or you will need to delay Blitz's execution long enough in 'human time' to let you SEE the picture. We will do the double buffering approach.
Example:
; LoadImage and DrawImage example
-
-; Declare a variable to hold the graphic file handle
-Global gfxPlayer
-
-; Set a graphics mode
-Graphics 640,480,16
-
-; Set drawing operations for double buffering
-SetBuffer BackBuffer()
-
-; Load the image and assign its file handle to the variable
-; - This assumes you have a graphic called player.bmp in the
-; same folder as this source code
-gfxPlayer=LoadImage("player.bmp")
-
-; Let's do a loop where the graphic is drawn wherever the
-; mouse is pointing. ESC will exit.
-While Not KeyHit(1)
-Cls ; clear the screen
-DrawImage gfxPlayer,MouseX(),MouseY() ; Draw the image!
-Flip ; flip the image into view and clear the back buffer
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/DrawImageRect.htm b/_release/help/commands/2d_commands/DrawImageRect.htm
index 6278ccb..b16ca1b 100644
--- a/_release/help/commands/2d_commands/DrawImageRect.htm
+++ b/_release/help/commands/2d_commands/DrawImageRect.htm
@@ -1,34 +1,69 @@
-Command: DrawImageRect DrawImageRect image,x,y,rect_x,rect_y,rect_width,rect_height,[frame] Definition:
Draws a rectangular area of an image at the designated location.
Parameter Description:
image = variable holding the image handle
-x = x location on the screen to draw the image
-y = y location on the screen to draw the image
-rect_x = starting x location within the image to draw
-rect_y = starting y location within the image to draw
-rect_width = the height of the area to draw
-rect_height = the width of the area to draw
-frame = optional frame number of image to draw
Command Description:
This command will let you draw a rectangular PORTION of an image to the designated location on the screen. The transparent/masked portions of the original image will be drawn transparent, just as you normally would draw an image.
+
+
+Blitz3D Docs
+
+
+
+
+image = variable holding the image handle
+x = x location on the screen to draw the image
+y = y location on the screen to draw the image
+rect_x = starting x location within the image to draw
+rect_y = starting y location within the image to draw
+rect_width = the height of the area to draw
+rect_height = the width of the area to draw
+frame = optional frame number of image to draw
+
+
+
+
Description
+
+
+
+This command will let you draw a rectangular PORTION of an image to the designated location on the screen. The transparent/masked portions of the original image will be drawn transparent, just as you normally would draw an image.
+
+This is handy if you are doing something like revealing part of a screen when the player uncovers something (think QIX). You could load the 'picture' into an image, then when the player clears a rectangular region, you could paste that portion of the final image onto the playfield. If you want to draw the image portion with no transparency or mask, use DrawBlockRect instead.
+
+; DrawImageRect Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create new empty graphic to store our circle in
+gfxCircle=CreateImage(50,50)
+
+; Draw the circle image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+SetBuffer FrontBuffer()
+
+
+; Let's draw portions of the circle randomly
+While Not KeyHit(1)
+; We take random sized portions of the circle and put them
+; at a random location ... wash, rinse, and repeat
+DrawImageRect gfxCircle,Rnd(640),Rnd(480),0,0,Rnd(50),Rnd(50),0
+Delay 100
+Wend
+
+
+
+
-This is handy if you are doing something like revealing part of a screen when the player uncovers something (think QIX). You could load the 'picture' into an image, then when the player clears a rectangular region, you could paste that portion of the final image onto the playfield. If you want to draw the image portion with no transparency or mask, use DrawBlockRect instead.
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Create new empty graphic to store our circle in
-gfxCircle=CreateImage(50,50)
-
-; Draw the circle image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-SetBuffer FrontBuffer()
-
-
-; Let's draw portions of the circle randomly
-While Not KeyHit(1)
-; We take random sized portions of the circle and put them
-; at a random location ... wash, rinse, and repeat
-DrawImageRect gfxCircle,Rnd(640),Rnd(480),0,0,Rnd(50),Rnd(50),0
-Delay 100
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/EOF.htm b/_release/help/commands/2d_commands/EOF.htm
index 5f393cd..71a979a 100644
--- a/_release/help/commands/2d_commands/EOF.htm
+++ b/_release/help/commands/2d_commands/EOF.htm
@@ -1,19 +1,54 @@
-Command: EOF EOF (filehandle|stream) Definition:
Checks to see if the End Of File (or stream) has been reached.
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
Command Description:
Checks to see if the End of File of an opened file or stream has been reached. Use this to determine if you should continue to pull more information from a file/stream or not. Use this to read a text file of unknown length (say a README.TXT) and display it. See example.
+
+
+Blitz3D Docs
+
+
+
+
Eof (filehandle/stream)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
+
+
+
+
Description
+
+
+
+Checks to see if the End of File of an opened file or stream has been reached. Use this to determine if you should continue to pull more information from a file/stream or not. Use this to read a text file of unknown length (say a README.TXT) and display it. See example.
+
+Eof returns 1 if eof has been reached or, in the case of a TCP stream, the stream has been 'nicely' closed.
+
+Eof returns -1 if something has gone wrong during stream processing.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Eof sample
+
+file$="c:autoexec.bat"
+
+filein = ReadFile(file$)
+
+Print "Here is your Autoexec.bat file ..."
+
+; Loop this until we reach the end of file
+While Not Eof(filein)
+Print ReadLine$(filein)
+Wend
+
+
+
+
-Eof returns 1 if eof has been reached or, in the case of a TCP stream, the stream has been 'nicely' closed.
+Index
-Eof returns -1 if something has gone wrong during stream processing.
-Streams can only be used in Blitz Basic v1.52 or greater.
Example:
; EOF sample
-
-file$="c:\autoexec.bat"
-
-filein = ReadFile(file$)
-
-Print "Here is your Autoexec.bat file ..."
-
-; Loop this until we reach the end of file
-While Not Eof(filein)
-Print ReadLine$(filein)
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Each.htm b/_release/help/commands/2d_commands/Each.htm
index 207da31..77b993d 100644
--- a/_release/help/commands/2d_commands/Each.htm
+++ b/_release/help/commands/2d_commands/Each.htm
@@ -1,9 +1,45 @@
-Command: Each Each type_variable Definition:
Used to iterate through a collection of TYPE objects.
Parameter Description:
type_variable = A previously declared TYPE object
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
The For .. Each loop allows you to walk through each object in the Type collection.
- This is perfect for updating a large group of objects (such as a group of alien
- invaders). Do look over the Type command.
Example:
; Move them all over 1 (like the description example from TYPE command)
-
For room.chair = Each chair
- room\x = room\x + 1
- Next
+type_variable = A previously declared TYPE object
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+The For .. Each loop allows you to walk through each object in the Type collection. This is perfect for updating a large group of objects (such as a group of alien invaders). Do look over the Type command.
+
+
+See also: Type, New, Before, After, First, Last, Insert, Delete.
+
+; Move them all over 1 (like the description example from TYPE command)
+
+For room.chair = Each chair
+room\x = room\x + 1
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Else If.htm b/_release/help/commands/2d_commands/Else If.htm
index c1bb057..cc9eefb 100644
--- a/_release/help/commands/2d_commands/Else If.htm
+++ b/_release/help/commands/2d_commands/Else If.htm
@@ -1,20 +1,55 @@
-Command: Else If Else If Definition:
Performs an additional IF condition check during an IF ... THEN conditional structure.
Parameter Description:
None
Command Description:
During a standard IF ... THEN conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider a SELECT/CASE structure. See the example.
Example:
; ELSE IF Example
+
+
+Blitz3D Docs
+
+
+
+
Else If
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+During a standard IF ... THEN conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider a SELECT/CASE structure. See the example.
-; Input the user's name
-name$=Input$("What is your name? ")
-; Doesn't the person's name equal SHANE?
-If name$ = "Shane" Then
+See also: ElseIf.
+
+; ELSEIF Example
+
+; Input the user's name
+name$=Input$("What is your name? ")
+
+; Doesn't the person's name equal SHANE?
+If name$ = "Shane" Then
+ Print "You are recognized, Shane! Welcome!"
+
+ElseIf name$="Ron" Then
+ Print "You are recognized too, Ron! Welcome!"
+
+Else
+ Print "Sorry, you don't belong here!"
+
+; End of the condition checking
+End If
+
+
+
-Print "You are recognized, Shane! Welcome!"
+Index
-Else If name$="Ron" then
-Print "You are recognized too, Ron! Welcome!"
-
-Else
-Print "Sorry, you don't belong here!"
-
-; End of the condition checking
-End If
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Else.htm b/_release/help/commands/2d_commands/Else.htm
index 12318fe..b9fd50d 100644
--- a/_release/help/commands/2d_commands/Else.htm
+++ b/_release/help/commands/2d_commands/Else.htm
@@ -1,11 +1,47 @@
-Command: Else Else Definition:
Begins the code to be executed in the event the IF conditional fails.
Parameter Description:
None.
Command Description:
There are times during an IF ... THEN conditional that you will want code to execute in the event that the conditional is NOT met. The ELSE command begins that block of code, and is terminated by the END IF command. See example.
Example:
; ELSE example
+
+
+Blitz3D Docs
+
+
+
+
Else
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+There are times during an IF ... THEN conditional that you will want code to execute in the event that the conditional is NOT met. The ELSE command begins that block of code, and is terminated by the END IF command. See example.
-name$=Input$("What is your name?")
-If name$="Shane" then
-Print "Hello Shane!"
-Else
-Print "I have NO clue who you are!"
-End If
-
+; ELSE example
+
+name$=Input$("What is your name?")
+
+If name$="Shane" then
+ Print "Hello Shane!"
+Else
+ Print "I have NO clue who you are!"
+End If
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ElseIf.htm b/_release/help/commands/2d_commands/ElseIf.htm
index 876875c..148dc61 100644
--- a/_release/help/commands/2d_commands/ElseIf.htm
+++ b/_release/help/commands/2d_commands/ElseIf.htm
@@ -1,2 +1,55 @@
-Command: ElseIf ElseIf Definition:
Alternate command for the END IF command, it performs an additional IF condition check during an IF ... THEN conditional structure.
Parameter Description:
None
Command Description:
During a standard IF ... THEN conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider a SELECT/CASE structure. See the example.
Example:
; ELSEIF Example
; Input the user's name name$=Input$("What is your name? ")
; Doesn't the person's name equal SHANE? If name$ = "Shane" Then
Print "You are recognized, Shane! Welcome!"
ElseIf name$="Ron" then Print "You are recognized too, Ron! Welcome!"
+During a standard IF ... THEN conditional structure, you may wish to check another condition if the original condition fails. This 'nested IF' situation can get WAY out of hand, and once you have more than two nested conditionals, you should consider aSELECT/CASE structure. See the example.
+
+
+See also: If, Then, Else, ElseIf, EndIf, Select.
+
+; ELSEIF Example
+
+; Input the user's name
+name$=Input$("What is your name? ")
+
+; Doesn't the person's name equal SHANE?
+If name$ = "Shane" Then
+ Print "You are recognized, Shane! Welcome!"
+
+ElseIf name$="Ron" Then
+ Print "You are recognized too, Ron! Welcome!"
+
+Else
+ Print "Sorry, you don't belong here!"
+
+; End of the condition checking
+End If
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/End Function.htm b/_release/help/commands/2d_commands/End Function.htm
index f394c25..3864d74 100644
--- a/_release/help/commands/2d_commands/End Function.htm
+++ b/_release/help/commands/2d_commands/End Function.htm
@@ -1,16 +1,50 @@
-Command: End Function End Function Definition:
Denotes the end of a Function structure.
Parameter Description:
None.
Command Description:
This line terminates a FUNCTION structure. Upon reaching this line, Blitz will branch program execution to the next command following the original call to the function. See the FUNCTION command for more information.
Example:
; End Function Example
+
+
+Blitz3D Docs
+
+
+
+
End Function
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+This line terminates a FUNCTION structure. Upon reaching this line, Blitz will branch program execution to the next command following the original call to the function. See the FUNCTION command for more information.
+
+; End Function Example
+
+; Get the user's name
+name$=Input$("Enter Your Name:")
+
+; Call a function to print how many letters the name has
+numletters(name$);
+
+;The program basically ends here, because functions don't run unless called.
+
+; The actual function
+Function numletters(passedname$)
+Print "Your name has " + Len(passedname$) + " letters in it."
+End Function
+
+
+
+
-; Get the user's name
-name$=Input$("Enter Your Name:")
+Index
-; Call a function to print how many letters the name has
-numletters(name$);
-
-;The program basically ends here, because functions don't run unless called.
-
-; The actual function
-Function numletters(passedname$)
-Print "Your name has " + Len(passedname$) + " letters in it."
-End Function
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/End If.htm b/_release/help/commands/2d_commands/End If.htm
index c0d59ef..e435011 100644
--- a/_release/help/commands/2d_commands/End If.htm
+++ b/_release/help/commands/2d_commands/End If.htm
@@ -1,18 +1,52 @@
-Command: End If End If Definition:
Closing element of an IF/THEN condition checking structure.
Parameter Description:
None.
Command Description:
END IF signals the end of an IF THEN condition check. See IF for more information. You can also use ENDIF as a single word command - it functions identically.
Example:
; IF THEN Example
+
+
+Blitz3D Docs
+
+
+
+
End If
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+END IF signals the end of an IF THEN condition check. See IF for more information. You can also use ENDIF as a single word command - it functions identically.
+
+; IF THEN Example
+
+; Input the user's name
+name$=Input$("What is your name? ")
+
+; Doesn't the person's name equal SHANE?
+If name$ = "Shane" Then
+
+Print "You are recognized, Shane! Welcome!"
+
+Else
+
+Print "Sorry, you don't belong here!"
+
+; End of the condition checking
+End If
+
+
+
+
-; Input the user's name
-name$=Input$("What is your name? ")
+Index
-; Doesn't the person's name equal SHANE?
-If name$ = "Shane" Then
-
-Print "You are recognized, Shane! Welcome!"
-
-Else
-
-Print "Sorry, you don't belong here!"
-
-; End of the condition checking
-End If
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/End Select.htm b/_release/help/commands/2d_commands/End Select.htm
index d52fbbf..dd79d07 100644
--- a/_release/help/commands/2d_commands/End Select.htm
+++ b/_release/help/commands/2d_commands/End Select.htm
@@ -1,27 +1,61 @@
-Command: End Select End Select Definition:
The closing command in a SELECT structure.
Parameter Description:
None.
Command Description:
This command ends the SELECT structure. If you are using DEFAULT commands, this is the ending point of that command set's execution. See SELECT, CASE, and DEFAULT for more information.
Example:
; SELECT/CASE/DEFAULT/END SELECT Example
-; Assign a random number 1-10
-mission=Rnd(1,10)
+
+
+Blitz3D Docs
+
+
+
+
End Select
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+This command ends the SELECT structure. If you are using DEFAULT commands, this is the ending point of that command set's execution. See SELECT, CASE, and DEFAULT for more information.
+
+; SELECT/CASE/DEFAULT/END SELECT Example
+; Assign a random number 1-10
+mission=Rnd(1,10)
+
+; Start the selection process based on the value of 'mission' variable
+Select mission
+
+; Is mission = 1?
+Case 1
+Print "Your mission is to get the plutonium and get out alive!"
+
+; Is mission = 2?
+Case 2
+Print "Your mission is to destroy all enemies!"
+
+; Is mission = 3?
+Case 3
+Print "Your mission is to steal the enemy building plans!"
+
+; What do do if none of the cases match the value of mission
+Default
+Print "Missions 4-10 are not available yet!"
+
+; End the selection process
+End Select
+
+
+
+
-; Start the selection process based on the value of 'mission' variable
-Select mission
+Index
-; Is mission = 1?
-Case 1
-Print "Your mission is to get the plutonium and get out alive!"
-
-; Is mission = 2?
-Case 2
-Print "Your mission is to destroy all enemies!"
-
-; Is mission = 3?
-Case 3
-Print "Your mission is to steal the enemy building plans!"
-
-; What do do if none of the cases match the value of mission
-Default
-Print "Missions 4-10 are not available yet!"
-
-; End the selection process
-End Select
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/End Type.htm b/_release/help/commands/2d_commands/End Type.htm
index 901edbe..3445801 100644
--- a/_release/help/commands/2d_commands/End Type.htm
+++ b/_release/help/commands/2d_commands/End Type.htm
@@ -1,12 +1,45 @@
-Command: End Type End Type Definition:
The last command of the TYPE ... END TYPE object creation.
Parameter Description:
None
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
+
+
+Blitz3D Docs
+
+
+
+
End Type
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+After assigning all the Field variables in your Type object, use this to finish the creation of the Type.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/End.htm b/_release/help/commands/2d_commands/End.htm
index c10973a..3168175 100644
--- a/_release/help/commands/2d_commands/End.htm
+++ b/_release/help/commands/2d_commands/End.htm
@@ -1,5 +1,41 @@
-Command: End End Definition:
Stops the program execution and exits the program.
Parameter Description:
None
Command Description:
Use this command to stop your program running. You will be returned to the editor if running from there, or the program will completely exit if running a compiled EXE version.
Example:
; If the game is over, then quit
+
+
+Blitz3D Docs
+
+
+
+
End
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+Use this command to stop your program running. You will be returned to the editor if running from there, or the program will completely exit if running a compiled EXE version.
-if gameOver=1 then End
-
+; If the game is over, then quit
+
+if gameOver=1 then End
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/EndGraphics.htm b/_release/help/commands/2d_commands/EndGraphics.htm
index 71fc58d..38fe8a4 100644
--- a/_release/help/commands/2d_commands/EndGraphics.htm
+++ b/_release/help/commands/2d_commands/EndGraphics.htm
@@ -1,22 +1,59 @@
-Command: EndGraphics EndGraphics Definition:
Ends the graphics mode.
Parameter Description:
None
Command Description:
This command ends the graphics mode, and puts Blitz back into 'text' mode (for lack of a better term).
Example:
; End Graphics Example
+
+
+Blitz3D Docs
+
+
+
+
EndGraphics
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Returns a program to a non-Graphics mode state. This is the same state that a program starts up in, before the Graphics command is used.
+
+One possible use for EndGraphics is to switch between full-screen and windowed states.
-; Enter graphics mode
-Graphics 640,480,16
-; Print hello 10 times on the graphic screen
-For t = 1 To 10
-Print "Hello"
-Next
+See also: Graphics.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/EndIF.htm b/_release/help/commands/2d_commands/EndIF.htm
index 1e9bdc8..6fd0226 100644
--- a/_release/help/commands/2d_commands/EndIF.htm
+++ b/_release/help/commands/2d_commands/EndIF.htm
@@ -1,18 +1,54 @@
-Command: EndIF EndIF Definition:
Another acceptable version of the END IF statement
Parameter Description:
None.
Command Description:
Terminates an IF ... THEN condition structure. See END IF for more information.
Example:
; IF THEN Example
+
+
+Blitz3D Docs
+
+
+
+
EndIf
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Terminates an IF ... THEN condition structure. See END IF for more information.
-; Input the user's name
-name$=Input$("What is your name? ")
-; Doesn't the person's name equal SHANE?
-If name$ = "Shane" Then
+See also: If, Then, Else, ElseIf, Select.
+
+; IF THEN Example
+
+; Input the user's name
+name$=Input$("What is your name? ")
+
+; Doesn't the person's name equal SHANE?
+If name$ = "Shane" Then
+
+ Print "You are recognized, Shane! Welcome!"
+
+Else
+
+ Print "Sorry, you don't belong here!"
+
+; End of the condition checking
+EndIf
+
+
+
-Print "You are recognized, Shane! Welcome!"
+Index
-Else
-
-Print "Sorry, you don't belong here!"
-
-; End of the condition checking
-EndIf
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ExecFile.htm b/_release/help/commands/2d_commands/ExecFile.htm
index 4c32f63..7eb2bae 100644
--- a/_release/help/commands/2d_commands/ExecFile.htm
+++ b/_release/help/commands/2d_commands/ExecFile.htm
@@ -1,20 +1,58 @@
-Command: ExecFile ExecFile (filename$) Definition:
Runs an external executable program from within a Blitz program.
Parameter Description:
filename$ = any valid variable or path/filename to the executable program
Command Description:
Use this command to halt execution of your program and run an external program.
+
+
+Blitz3D Docs
+
+
+
+
ExecFile( file$ )
+
Parameters
+
+
+
+file$ - the file to be executed
+
+
+
+
Description
+
+
+
+The usefulness of this command is really mostly for calling some system level command, launching a browser, etc.
+
+Note: This command uses ShellExecute to allow you to 'open' any file (like a .doc or .txt) file with its default associated program.
+
+Also: if the filename path has spaces in it you may will need to chenge the call like so:
+
+ExecFile (Chr$(34)+"example file name.exe"+Chr$(34))
+
+This adds the " (quotation mark) character to the beginning and end of the text string.
+
+; ExecFile sample - RUN THIS WINDOWED!
+Graphics 320,240,0,2
+
+filename$ = Chr$(34) + "calc.exe" + Chr$(34)
+
+Text 5,5, "press any key to run CALC.EXE!"
+Flip
+WaitKey
+
+ExecFile(filename$)
+
+Text 5,25, "Press any key to quit."
+Flip
+WaitKey
+End
+
+
+
-The usefulness of this command is really mostly for calling some system level command, launching a browser, etc. Without the ability to playback a movie (for cutscenes, etc) I would think the most useful part of this is command would be calling a self-contained .exe movie (a la BLINK) to play as an intro, then when its completed, return to your program for continued execution.
+Index
-Note: This command uses ShellExecute to allow you to 'open' any file (like a .doc or .txt) file with its default associated program.
Example:
; ExecFile sample - RUN THIS WINDOWED!
-; Win9x users will need to change location of calc.exe
-
-filename$="c:\winnt\system32\calc.exe"
-
-Print "Press any key to run CALC.EXE!"
-
-WaitKey()
-
-ExecFile(filename$)
-
-Print "Press any key to quit."
-
-WaitKey()
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Exit.htm b/_release/help/commands/2d_commands/Exit.htm
index e9f1f73..685c3ef 100644
--- a/_release/help/commands/2d_commands/Exit.htm
+++ b/_release/help/commands/2d_commands/Exit.htm
@@ -1,7 +1,44 @@
-Command: Exit Exit Definition:
Exits a loop prematurely.
Parameter Description:
None
Command Description:
This command will allow you to leave a For .. Next loop as well as many other types of loops prematurely (assuming a condition was met or other planned event). It exits the IMMEDIATE loop - you'll need one for each 'nest' of loops you want to exit from.
Example:
; EXIT Command sample
+
+
+Blitz3D Docs
+
+
+
+
Exit
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+This command will allow you to leave a For .. Next loop as well as many other types of loops prematurely (assuming a condition was met or other planned event). It exits the IMMEDIATE loop - you'll need one for each 'nest' of loops you want to exit from.
-For t = 1 To 100
- Print t
- If t = 50 Then Exit
-Next
+; EXIT Command sample
+
+For t = 1 To 100
+Print t
+If t = 50 Then Exit
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Exp.htm b/_release/help/commands/2d_commands/Exp.htm
index 4f3059d..226d9cc 100644
--- a/_release/help/commands/2d_commands/Exp.htm
+++ b/_release/help/commands/2d_commands/Exp.htm
@@ -1,6 +1,66 @@
-Command: Exp Exp (number) Definition:
Returns the base of the natural system of logarithms e, raised to the power of the supplied argument.
Parameter Description:
number=float or integer
Command Description:
Exp() is the exponential function. Logarithms to the base e are called the Natural or Napierian logarithms. The Exp() and Log functions use the transcendental number e as a base (approx 2.718). Exp() is the inverse of the antilogarithm Log function.
-See also: LogLog10
Example:
; To find the value of e
-print Exp(1) ; i.e. e^1, returns 2.718281
-; To find the value of e^5
-print Exp(5) ; returns 148.413162
+This is e^x where e = 2.71828...
+
+For the curious, e is defined by the infinite sum:
+
+2 + 1/(2) + 1/(2*3) + 1/(2*3*4) + 1/(2*3*4*5) + ...
+
+See also Log()
+
+; Exp example
+
+; Exp(x) is the same as e^x.
+
+; Actually, due to the approximate nature of floating point arithmetic
+; these will not be exactly equal. But in the following example
+; the difference is so small you can't see it.
+
+e# = 2.71828182845905 ; over-specified, might help and can't hurt.
+
+x# = .125 ; = 1/8
+
+Print " x Exp(x) e^x "
+Print "======= ========= ========="
+
+For k = 1 To 7
+
+Write " " + LSet( x , 7 )
+Write RSet( Exp( x ), 10 )
+Print RSet( e^x , 12 )
+x = 2 * x
+
+Next
+
+WaitKey() : End
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/False.htm b/_release/help/commands/2d_commands/False.htm
index d6b4595..fadf641 100644
--- a/_release/help/commands/2d_commands/False.htm
+++ b/_release/help/commands/2d_commands/False.htm
@@ -1,21 +1,57 @@
-Command: False False Definition:
A boolean expression used in comparisons. Actually returns a value of 0.
Parameter Description:
None.
Command Description:
FALSE is a keyword to denote a negative result in a conditional statement. Often times, FALSE is implied and doesn't need to be directly referenced - or a NOT command is used in the comparison. FALSE can also be used as a RETURN value from a FUNCTION. Also see the TRUE command. See the example.
Example:
; FALSE example
+
+
+Blitz3D Docs
+
+
+
+
False
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+FALSE is a keyword to denote a negative result in a conditional statement. Often times, FALSE is implied and doesn't need to be directly referenced - or a NOT command is used in the comparison. FALSE can also be used as a RETURN value from aFUNCTION. Also see the TRUE command. See the example.
-; Assign test a random number of 0 or 1
-test= Rnd(0,1)
-; FALSE is implied because of the NOT
-If not test=1 Then
-Print "Test was valued at 0"
-End If
+See also: True, If, Select, While, Repeat.
+
+; FALSE example
+
+; Assign test a random number of 0 or 1
+test= Rnd(0,1)
+
+; FALSE is implied because of the NOT
+If not test=1 Then
+Print "Test was valued at 0"
+End If
+
+; Let's set test to be false
+test=False
+
+; Pointlessly test it
+If test=False Then
+Print "Test is false"
+else
+print "Test is true"
+End If
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Field.htm b/_release/help/commands/2d_commands/Field.htm
index 809c0e3..0645dd4 100644
--- a/_release/help/commands/2d_commands/Field.htm
+++ b/_release/help/commands/2d_commands/Field.htm
@@ -1,28 +1,64 @@
-Command: Field Field variable Definition:
Assigns a variable for use into a TYPE object structure.
Parameter Description:
variable = any legal variable
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
When you define a custom Type, you need to assign some variables to track within
- in. Using the Field command within the Type .. End
- Type commands, you set a variable that can be used for EACH object created
- with the NEW
- command.
Example:
; Define the CHAIR Type
-
- Type CHAIR
- Field X
- Field Y
- Field HEIGHT
- End Type
-
; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
-
For tempx = 1 to 10
- For tempy = 1 to 10
- room.chair = New Chair
- room\x = tempx
- room\y = tempy
- room\height = Rnd(0,10) ; set a random height 0 to 10
- Next
- Next
-
; Move them all over 1 (like the description example from TYPE command)
-
For room.chair = Each chair
- room\x = room\x + 1
- Next
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+When you define a custom Type, you need to assign some variables to track within in. Using the Field command within the Type .. End Type commands, you set a variable that can be used for EACH object created with the NEW command.
+
+
+See also: Type, End Type.
+
+; Define the CHAIR Type
+
+Type CHAIR
+Field X
+Field Y
+Field HEIGHT
+End Type
+
+; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
+
+For tempx = 1 to 10
+For tempy = 1 to 10
+room.chair = New Chair
+room\x = tempx
+room\y = tempy
+room\height = Rnd(0,10) ; set a random height 0 to 10
+Next
+Next
+
+; Move them all over 1 (like the description example from TYPE command)
+
+For room.chair = Each chair
+room\x = room\x + 1
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FilePos.htm b/_release/help/commands/2d_commands/FilePos.htm
index 6f25b2d..cd4b6c8 100644
--- a/_release/help/commands/2d_commands/FilePos.htm
+++ b/_release/help/commands/2d_commands/FilePos.htm
@@ -1,69 +1,98 @@
-Command: FilePos FilePos (filehandle) Definition:
Returns the current position within a file that is being read, written or modified.
Parameter Description:
filehandle = the variable returned by the Readfile WriteFile or OpenFile when the file was opened. The value returned is the offset from the start of the file. ( 0 = Start of
-the file )
Command Description:
This command returns the current position within a file that is being processed following ReadFile, WriteFile or OpenFile. The returned integer is the offsets in bytes from the start of the file to the current read/write position. Note, this is zero when pointing to the first byte of the file.
+
+
+Blitz3D Docs
+
+
+
+
FilePos (filehandle)
+
Parameters
+
+
+
+filehandle = the variable returned by the Readfile WriteFile or OpenFile when the file was opened. The value returned is the offset from the start of the file. ( 0 = Start of the file )
+
+
+
+
Description
+
+
+
+This command returns the current position within a file that is being processed following ReadFile, WriteFile or OpenFile. The returned integer is the offsets in bytes from the start of the file to the current read/write position. Note, this is zero when pointing to the first byte of the file.
+
+By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working through the whole file sequentially. This could be useful if you have created a database file and you want to find and update just a few records within it. It is also possible to create an index file that contains pointers to where each record starts in a data file.
+
+; Changing part of a file using OpenFile, SeekFile, FilePos
+; note FilePos is used in the SearchFile function at the end of this example
+
+; Open/create a file to Write
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteInt( fileout, 1 )
+WriteInt( fileout, 2 )
+WriteInt( fileout, 3 )
+WriteInt( fileout, 4 )
+WriteInt( fileout, 5 )
+
+; Close the file
+CloseFile( fileout )
+
+DisplayFile( "The file as originally written", mydata.dat" )
+Position = SearchFile( 4 , "mydata.dat" )
+Write "Value 4 was found "
+Write Position
+Print " bytes from the start."
+Print
+
+; Open the file and change the value 3 to 9999
+
+file = OpenFile("mydata.dat")
+SeekFile( file, Position ) ; Move to the found location
+WriteInt( file, 9999 ) ; Replace the original value with 9999
+CloseFile( file )
+
+
+DisplayFile( "The file after being modified", "mydata.dat" )
+WaitKey()
+End ; End of program
+
+; **** Function Definitions follow ****
+
+; Read the file and print it
+Function DisplayFile( Tittle$, Filename$ )
+Print tittle$
+file = ReadFile( Filename$ )
+While Not Eof( file )
+Number = ReadInt( file )
+Print Number
+Wend
+CloseFile( file )
+Print
+End Function
+
+; Search a file of integers for the Wanted data value
+; Note the need to subtract 4 from the location since having read it
+; we are now pointing at the next Integer also Return() was placed
+; after closing the file so it is closed properly
+Function SearchFile( Wanted, Filename$ )
+file = ReadFile( Filename$ )
+While Not Eof( file )
+If ReadInt( file ) = Wanted Then Location = FilePos( file ) - 4
+Wend
+CloseFile( file )
+Return( Location )
+End Function
+
+
+
-By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working through the whole file sequentially. This could be useful if you have
-created a database file and you want to find and update just a few records within it. It is also possible to create an index file that contains pointers to where each record starts in a data file.
+Index
; Changing part of a file using OpenFile, SeekFile, FilePos
-; note FilePos is used in the SearchFile function at the end of this example
-
-; Open/create a file to Write
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteInt( fileout, 1 )
-WriteInt( fileout, 2 )
-WriteInt( fileout, 3 )
-WriteInt( fileout, 4 )
-WriteInt( fileout, 5 )
-
-; Close the file
-CloseFile( fileout )
-
-DisplayFile( "The file as originally written", mydata.dat" )
-Position = SearchFile( 4 , "mydata.dat" )
-Write "Value 4 was found "
-Write Position
-Print " bytes from the start."
-Print
-
-; Open the file and change the value 3 to 9999
-
-file = OpenFile("mydata.dat")
-SeekFile( file, Position ) ; Move to the found location
-WriteInt( file, 9999 ) ; Replace the original value with 9999
-CloseFile( file )
-
-
-DisplayFile( "The file after being modified", "mydata.dat" )
-WaitKey()
-End ; End of program
-
-; **** Function Definitions follow ****
-
-; Read the file and print it
-Function DisplayFile( Tittle$, Filename$ )
- Print tittle$
- file = ReadFile( Filename$ )
- While Not Eof( file )
- Number = ReadInt( file )
- Print Number
- Wend
- CloseFile( file )
- Print
-End Function
-
-; Search a file of integers for the Wanted data value
-; Note the need to subtract 4 from the location since having read it
-; we are now pointing at the next Integer also Return() was placed
-; after closing the file so it is closed properly
-Function SearchFile( Wanted, Filename$ )
- file = ReadFile( Filename$ )
- While Not Eof( file )
- If ReadInt( file ) = Wanted Then Location = FilePos( file ) - 4
- Wend
- CloseFile( file )
- Return( Location )
-End Function
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FileSize.htm b/_release/help/commands/2d_commands/FileSize.htm
index 761425f..4c86430 100644
--- a/_release/help/commands/2d_commands/FileSize.htm
+++ b/_release/help/commands/2d_commands/FileSize.htm
@@ -1,10 +1,44 @@
-Command: FileSize FileSize (filename$) Definition:
Returns the size of the requested file - in bytes.
Parameter Description:
filename$ = any valid variable with path/filename
Command Description:
Often it will be useful to return the size of a file. File size is important for copying, reading, and other file evolutions.
Example:
; Windows 9x users will need to change location of calc.exe
-
-filename$="c:\winnt\system32\calc.exe"
+
+
+Blitz3D Docs
+
+
+
+
FileSize (filename$)
+
Parameters
+
+
+
+filename$ = any valid variable with path/filename
+
+
+
+
Description
+
+
+
+Often it will be useful to return the size of a file. File size is important for copying, reading, and other file evolutions.
+
+; Windows 2000/XP users will need to change location of calc.exe
+
+filename$="c:\windows\calc.exe"
+
+Print "The size of the file is: " + FileSize(filename$)
+
+Print "Press any key to quit."
+
+WaitKey()
+
+
+
-Print "The size of the file is: " + FileSize(filename$)
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FileType.htm b/_release/help/commands/2d_commands/FileType.htm
index 0a1d467..4cf0937 100644
--- a/_release/help/commands/2d_commands/FileType.htm
+++ b/_release/help/commands/2d_commands/FileType.htm
@@ -1,18 +1,52 @@
-Command: FileType FileType (filename$) Definition:
Checks to see if the designated filename exists or is a directory.
Parameter Description:
filename$ = any valid variable with path/filename
Command Description:
This command checks the filename you pass and determines if it exists and whether or not it is a valid filename or if it is a directory. Here are the values it returns:
+
+
+Blitz3D Docs
+
+
+
+
FileType (filename$)
+
Parameters
+
+
+
+filename$ = any valid variable with path/filename
+
+
+
+
Description
+
+
+
+This command checks the filename you pass and determines if it exists and whether or not it is a valid filename or if it is a directory. Here are the values it returns:
+
+1 = The filename exists
+0 = The filename doesn't exist
+2 = The filename is not a file - but a directory
+
+Use this to validate that a file exists before you do something to it.
+
+; Windows 9x users will need to change location of calc.exe
+
+filename$="c:winntsystem32calc.exe"
+
+if fileType(filename$)=1 then Print "The file exists!"
+if fileType(filename$)=0 then Print "File not found!"
+if fileType(filename$)=2 then Print "This is a directory!"
+
+Print "Press any key to quit."
+
+WaitKey()
+
+
+
-1 = The filename exists
-0 = The filename doesn't exist
-2 = The filename is not a file - but a directory
+Index
-Use this to validate that a file exists before you do something to it.
Example:
; Windows 9x users will need to change location of calc.exe
-
-filename$="c:\winnt\system32\calc.exe"
-
-if fileType(filename$)=1 then Print "The file exists!"
-if fileType(filename$)=0 then Print "File not found!"
-if fileType(filename$)=2 then Print "This is a directory!"
-
-Print "Press any key to quit."
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/First.htm b/_release/help/commands/2d_commands/First.htm
index d64c2ba..4a45feb 100644
--- a/_release/help/commands/2d_commands/First.htm
+++ b/_release/help/commands/2d_commands/First.htm
@@ -1,43 +1,89 @@
-Command: First First type_variable Definition:
Move the Type object pointer to the first object in the collection.
Parameter Description:
type_variable = the actual Type name, not the custom Type name
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
Use this to assign a custom Type object to the first object in the collection.
- See the example.
Example:
; Define a crafts Type
-
Type crafts
- Field x
- Field y
- Field dead
- Field graphic
- End Type
-
; Create 100 crafts, with the unique name of alien
- For t = 1 To 100
- alien.crafts = New crafts
- alien\x = Rnd(0,640)
- alien\y = Rnd(0,480)
- alien\dead = 0
- alien\graphic = 1
- Next
-
; Move to the first object
- alien.crafts = First crafts
+type_variable = the actual Type name, not the custom Type name
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+Use this to assign a custom Type object to the first object in the collection. See the example.
+
+
+See also: Type, New, Before, After, Last, Each, Insert, Delete.
+
+; Define a crafts Type
+
+Type crafts
+Field x
+Field y
+Field dead
+Field graphic
+End Type
+
+; Create 100 crafts, with the unique name of alien
+For t = 1 To 100
+alien.crafts = New crafts
+alien\x = Rnd(0,640)
+alien\y = Rnd(0,480)
+alien\dead = 0
+alien\graphic = 1
+Next
+
+; Move to the first object
+alien.crafts = First crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the next alien object
+alien = After alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the last alien object
+alien.crafts = Last crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the second to the last alien object
+alien = Before alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Flip.htm b/_release/help/commands/2d_commands/Flip.htm
index 976cca2..d4ca825 100644
--- a/_release/help/commands/2d_commands/Flip.htm
+++ b/_release/help/commands/2d_commands/Flip.htm
@@ -1,21 +1,66 @@
-Command: Flip Flip [vwait] Definition:
In a double buffering environment, flips the BackBuffer into view.
Parameter Description:
vwait = set to TRUE to wait for vertical blank to finish
Command Description:
When you are double buffering (or doing all drawing operations to the BackBuffer(), at some point, after you've drawn all your elements - you will need to 'flip' that Backbuffer into the visible FrontBuffer() so it can be seen. This command will perform this function. This allows you to draw massive amounts of information quickly, then flip it into view. See BackBuffer() for more info.
+vwait = set to FALSE to disable frame syncing, defaults to TRUE which waits for vertical blank to finish
+
+
+
+
Description
+
+
+
+Flip will switch the FrontBuffer() and BackBuffer().
+
+
+This command should be used when you are using Double Buffering. Double Buffering is a technique used to ensure that screen updates are not visible to the user. If you draw directly to the FrontBuffer, the display may appear flickery as the updates are drawn directly to the screen. If you draw to the BackBuffer, the updates are drawn in memory. Flip is then used to make the BackBuffer the FrontBuffer, and hence show the updates on screen in one go. At the same time, the FrontBuffer becomes the BackBuffer, allowing you to draw the next screen update on the BackBuffer before Flipping again.
+
+
+The vwait parameter defines whether or not the graphics card will wait for the vertical blank before flipping the screen. The vertical blank is an event that occurs at the frequency of the monitors refresh rate, and corresponds to the point in time when the last line on the screen has been drawn, and the top line is about to be drawn by the monitor. By waiting until the vertical blank, you ensure smooth updates to the screen as the image being drawn by the monitor will change only once the entire screen has been drawn by the monitor, and the screen is just about to start being refreshed.
+
+
+However, it is worth noting that this setting applies to the graphics card only, and some graphics cards allow the user to disable the vertical blank event. Therefore, if you rely on Flip alone, the display may be corrupted on certain setups. The VWait command may be useful to you in this respect, as it forces the CPU to wait for the vertical blank (as opposed to the graphics card), and this cannot be disabled. Hence true silky smooth updates are best achieved using "VWait : Flip False".
-; Set Graphics Mode
-Graphics 640,480
+; Flip/Backbuffer()/Rect Example
+
+; Set Graphics Mode
+Graphics 640,480
+
+; Go double buffering
+SetBuffer BackBuffer()
+
+; Setup initial locations for the box
+box_x = -20 ; negative so it will start OFF screen
+box_y = 100
+
+While Not KeyHit(1)
+Cls ; Always clear screen first
+Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
+Flip ; Flip it into view
+box_x = box_x + 1 ; Move the box over one pixel
+If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
+Wend
+
+
+
-; Setup initial locations for the box
-box_x = -20 ; negative so it will start OFF screen
-box_y = 100
+Index
-While Not KeyHit(1)
-Cls ; Always clear screen first
-Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
-Flip ; Flip it into view
-box_x = box_x + 1 ; Move the box over one pixel
-If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Float.htm b/_release/help/commands/2d_commands/Float.htm
index 833de37..21f4bc7 100644
--- a/_release/help/commands/2d_commands/Float.htm
+++ b/_release/help/commands/2d_commands/Float.htm
@@ -1,10 +1,68 @@
-Command: Float Float variable/value Definition:
Convert integer value to a floating point number.
Parameter Description:
variable/value = integer value or variable
Command Description:
Use this command to transform an integer value to a floating point value (presumably to perform a floating point related math function on it). Blitz does a good job of adding dissimilar number types, but if you want to play by the rules and/or port code to/from Blitz, remember to convert your integers to floating point before doing math upon them with dissimilar types.
Example:
; Float example
+
+
+Blitz3D Docs
+
+
+
+
Float#( value )
+
Parameters
+
+
+
+value = a number, or a string which represents a number
+
+
+
+
Description
+
+
+
+This is the same as Blitz's automatic type conversion.
+So the two commands...
+
+y# = value
+y# = Float( value )
+
+... do exactly the same thing.
+
+If Float is applied to a string it converts as much as possible:
+
+Float( "10" ) ...... result is 10.0
+Float( "3junk" ) .. result is 3.0
+Float( "junk3" ) .. result is 0.0
+
+In the latter two examples Float() stops converting when it sees "j".
+
+The typical use is to force floating point arithmetic:
+
+y# = 12 / 5 .............. result is 2.0 because 12 / 5 = 2 ( integer division )
+y# = float( 12 ) / 5 .... result is 2.4
+
+; Float example
+; =============
+
+Print "Enter some text to be converted using Float()."
+Print "Hit ENTER to exit."
+
+Repeat
+s$ = Input$(">")
+If s$<>"" Then
+Print "Float("+Chr$(34)+s$+Chr$(34)+")=" + Float(s$)
+End If
+Until s$=""
+
+End
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Floor.htm b/_release/help/commands/2d_commands/Floor.htm
index c249560..3fc22fd 100644
--- a/_release/help/commands/2d_commands/Floor.htm
+++ b/_release/help/commands/2d_commands/Floor.htm
@@ -1,12 +1,90 @@
-Command: Floor# Floor# (float) Definition:
Rounds a decimal floating variable down to the nearest whole number.
Parameter Description:
float=floating point number
Command Description:
Many times, you will need to round up or down a floating point decimal variable. This command rounds it down to the nearest whole number. Use Ceil# to round the number up.
Example:
; Floor#/Ceil# Example
+
+
+Blitz3D Docs
+
+
+
+
Floor# ( y# )
+
Parameters
+
+
+
+y = any number
+
+
+
+
Description
+
+
+
+Rounds downward, i.e. in the direction of -Infinity.
+
+It is a common mistake to think this simply sets everything after the decimal point to zero.
+But this is true only for positive numbers:
+
+Floor( 1.75 ) ....... 1.0
+Floor( -1.75 ) .... -2.0
+
+See also Ceil and Int for other types of rounding.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FlushJoy.htm b/_release/help/commands/2d_commands/FlushJoy.htm
index e6998d0..7bb4d44 100644
--- a/_release/help/commands/2d_commands/FlushJoy.htm
+++ b/_release/help/commands/2d_commands/FlushJoy.htm
@@ -1,10 +1,45 @@
-Command: FlushJoy FlushJoy Definition:
Flushes out all the queued up joystick button presses.
Parameter Description:
None.
Command Description:
There are many times when you aren't interested in the dozens of possible joystick button pressed the player might have made before you are checking for one in particular. Or perhaps you want to pause the game and wait for any joystick button to be hit, but you don't want a 'queued' button press bypassing this. Use this command before you specifically want to poll a joystick button hit from the user.
Example:
; FlushJoy sample
+
+
+Blitz3D Docs
+
+
+
+
FlushJoy
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+There are many times when you aren't interested in the dozens of possible joystick button pressed the player might have made before you are checking for one in particular. Or perhaps you want to pause the game and wait for any joystick button to be hit, but you don't want a 'queued' button press bypassing this. Use this command before you specifically want to poll a joystick button hit from the user.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FlushKeys.htm b/_release/help/commands/2d_commands/FlushKeys.htm
index 07bf1dc..da160e2 100644
--- a/_release/help/commands/2d_commands/FlushKeys.htm
+++ b/_release/help/commands/2d_commands/FlushKeys.htm
@@ -1,4 +1,38 @@
-Command: FlushKeys FlushKeys Definition:
Flushes all the currently queued keystrokes.
Parameter Description:
None.
Command Description:
This command 'resets' or 'empties out' the queue holding the keyboard inputs. Can't make it much easier than that.
Example:
; clear all keystrokes from the queue
-FlushKeys
-
+; clear all keystrokes from the queue
+FlushKeys
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FlushMouse.htm b/_release/help/commands/2d_commands/FlushMouse.htm
index bc622be..f7c653e 100644
--- a/_release/help/commands/2d_commands/FlushMouse.htm
+++ b/_release/help/commands/2d_commands/FlushMouse.htm
@@ -1,10 +1,45 @@
-Command: FlushMouse FlushMouse Definition:
Flushes out all the queued up mouse button presses.
Parameter Description:
None.
Command Description:
There are many times when you aren't interested in the dozens of possible mouse button pressed the player might have made before you are checking for one in particular. Or perhaps you want to pause the game and wait for any mouse button to be hit, but you don't want a 'queued' button press bypassing this. Use this command before you specifically want to poll a mouse button hit from the user.
Example:
; Flushmouse sample
+
+
+Blitz3D Docs
+
+
+
+
FlushMouse
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+There are many times when you aren't interested in the dozens of possible mouse button pressed the player might have made before you are checking for one in particular. Or perhaps you want to pause the game and wait for any mouse button to be hit, but you don't want a 'queued' button press bypassing this. Use this command before you specifically want to poll a mouse button hit from the user.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FontHeight.htm b/_release/help/commands/2d_commands/FontHeight.htm
index cdb2c81..510849e 100644
--- a/_release/help/commands/2d_commands/FontHeight.htm
+++ b/_release/help/commands/2d_commands/FontHeight.htm
@@ -1,23 +1,58 @@
-Command: FontHeight() FontHeight() Definition:
Returns the height of the currently selected font.
Parameter Description:
None.
Command Description:
This returns the height, in pixels, of the currently selected font (using SetFont - previously loaded with LoadFont).
+; FontWidth()/FontHeight example
+
+; enable graphics mode
+Graphics 800,600,16
+
+; Set global on font variable
+Global fntArial
+
+;Load fonts to a file handle variables
+fntArial=LoadFont("Arial",13,False,False,False)
+
+; set the font and print sizes
+SetFont fntArial
+Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False
+Text 400,30,"The height of the font is:"+ FontHeight(),True,False
+
+; Standard 'wait for ESC' from user
+While Not KeyHit(1)
+Wend
+
+; Clear all the fonts from memory!
+FreeFont fntArial
+
+
-; Set global on font variable
-Global fntArial
-
-;Load fonts to a file handle variables
-fntArial=LoadFont("Arial",13,False,False,False)
-
-; set the font and print sizes
-SetFont fntArial
-Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False
-Text 400,30,"The height of the font is:"+ FontHeight(),True,False
-
-; Standard 'wait for ESC' from user
-While Not KeyHit(1)
-Wend
-
-; Clear all the fonts from memory!
-FreeFont fntArial
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FontWidth.htm b/_release/help/commands/2d_commands/FontWidth.htm
index 80d1d4b..b486cc1 100644
--- a/_release/help/commands/2d_commands/FontWidth.htm
+++ b/_release/help/commands/2d_commands/FontWidth.htm
@@ -1,23 +1,58 @@
-Command: FontWidth() FontWidth() Definition:
Returns the width of the widest character of the currently selected font.
Parameter Description:
None.
Command Description:
This returns the width, in pixels, of the currently selected font (using SetFont - previously loaded with LoadFont). This command returns the width of the WIDEST character of the font.
+This returns the width, in pixels, of the currently selected font (using SetFont - previously loaded with LoadFont). This command returns the width of the WIDEST character of the font.
+
+; FontWidth()/FontHeight example
+
+; enable graphics mode
+Graphics 800,600,16
+
+; Set global on font variable
+Global fntArial
+
+;Load fonts to a file handle variables
+fntArial=LoadFont("Arial",13,False,False,False)
+
+; set the font and print sizes
+SetFont fntArial
+Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False
+Text 400,30,"The height of the font is:"+ FontHeight(),True,False
+
+; Standard 'wait for ESC' from user
+While Not KeyHit(1)
+Wend
+
+; Clear all the fonts from memory!
+FreeFont fntArial
+
+
-; Set global on font variable
-Global fntArial
-
-;Load fonts to a file handle variables
-fntArial=LoadFont("Arial",13,False,False,False)
-
-; set the font and print sizes
-SetFont fntArial
-Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False
-Text 400,30,"The height of the font is:"+ FontHeight(),True,False
-
-; Standard 'wait for ESC' from user
-While Not KeyHit(1)
-Wend
-
-; Clear all the fonts from memory!
-FreeFont fntArial
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/For.htm b/_release/help/commands/2d_commands/For.htm
index 675b3cc..4e1ca3f 100644
--- a/_release/help/commands/2d_commands/For.htm
+++ b/_release/help/commands/2d_commands/For.htm
@@ -1,14 +1,50 @@
-Command: For For variable Definition:
First command of the FOR ... NEXT loop.
Parameter Description:
variable = any valid variable name
Command Description:
The first command of the FOR ... NEXT loop, this command is used to assign a variable to a range of numbers in sequence and execute a set of code that many times. Using the STEP command allows you to skip a certain value between each loop of the code.
+
+
+Blitz3D Docs
+
+
+
+
For variable
+
Parameters
+
+
+
+variable = any valid variable name
+
+
+
+
Description
+
+
+
+The first command of the FOR ... NEXT loop, this command is used to assign a variable to a range of numbers in sequence and execute a set of code that many times. Using the STEP command allows you to skip a certain value between each loop of the code. Note that the STEP amount cannot be a variable.
+
+This is frequently used when a specific pattern of numbers is needed to perform an evolution (moving something from point A to point B, adding a value to a score incrementally, etc). This allows you to assign a variable with the current value of the loop. See the example for more.
+Note: Unlike many BASIC languages, the NEXT command does NOT use the FOR command's variable as an identifier. If you have nested FOR ... NEXT commands, the language will automatically match the NEXT with the nearest FOR command.
-This is frequently used when a specific pattern of numbers is needed to perform an evolution (moving something from point A to point B, adding a value to a score incrementally, etc). This allows you to assign a variable with the current value of the loop. See the example for more.
-Note: Unlike many BASIC languages, the NEXT command does NOT use the FOR command's variable as an identifier. If you have nested FOR ... NEXT commands, the language will automatically match the NEXT with the nearest FOR command.
Example:
; Print the values 1 through 10
-For t = 1 To 10
-Print t
-Next
-; Print the values 1,3,5,7,9
-For t = 1 To 10 Step 2
-Print t
-Next
-
+; Print the values 1 through 10
+For t = 1 To 10
+Print t
+Next
+
+; Print the values 1,3,5,7,9
+For t = 1 To 10 Step 2
+Print t
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Forever.htm b/_release/help/commands/2d_commands/Forever.htm
index 29ea7f7..1c7fb30 100644
--- a/_release/help/commands/2d_commands/Forever.htm
+++ b/_release/help/commands/2d_commands/Forever.htm
@@ -1,10 +1,46 @@
-Command: Forever Forever Definition:
Used in a REPEAT loop to make the loop run endlessly.
Parameter Description:
None.
Command Description:
Replace the UNTIL command in a REPEAT ... UNTIL loop to make the loop run forever. Remember, the program execution will continue indefinately until either you break out of it programmatically! This is often known as 'the infinate loop'. Once more for the cheap seats: "Make sure you provide a means for breaking out of the loop". Use EXIT (to leave the loop) or END to quit the program.
Example:
; FOREVER Example
+
+
+Blitz3D Docs
+
+
+
+
Forever
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Replace the UNTIL command in aREPEAT ... UNTIL loop to make the loop run forever. Remember, the program execution will continue indefinately until either you break out of it programmatically! This is often known as 'the infinate loop'. Once more for the cheap seats: "Make sure you provide a means for breaking out of the loop". Use EXIT (to leave the loop) or END to quit the program.
-Repeat
-If KeyHit(1) Then Exit
-Print "You are trapped in an infinate loop! Press ESC!"
-Forever
+; FOREVER Example
+
+Repeat
+If KeyHit(1) Then Exit
+Print "You are trapped in an infinate loop! Press ESC!"
+Forever
+
+Print "The infinate loop has ended!"
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FreeBank.htm b/_release/help/commands/2d_commands/FreeBank.htm
index 8b996e7..6016111 100644
--- a/_release/help/commands/2d_commands/FreeBank.htm
+++ b/_release/help/commands/2d_commands/FreeBank.htm
@@ -1,20 +1,54 @@
-Command: FreeBank FreeBank bank Definition:
Frees a memory bank from memory.
Parameter Description:
bank = variable containing handle to valid bank
Command Description:
This releases a memory bank allocated with the CreateBank command.
Example:
; Bank Commands Example
+
+
+Blitz3D Docs
+
+
+
+
FreeBank bank
+
Parameters
+
+
+
+bank - bank handle
+
+
+
+
Description
+
+
+
+Frees a bank.
-bnkTest=CreateBank(500)
-For t = 1 To 50
-PokeByte bnkTest,t,Rnd(255)
-PokeInt bnkTest,t+1,Rnd(10000)
-PokeShort bnkTest,t+2,Rnd(10000)
-PokeFloat bnkTest,t+3,Rnd(-.999,.999)
-Next
+See also: CreateBank.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FreeFont.htm b/_release/help/commands/2d_commands/FreeFont.htm
index f2c70a8..d934591 100644
--- a/_release/help/commands/2d_commands/FreeFont.htm
+++ b/_release/help/commands/2d_commands/FreeFont.htm
@@ -1,45 +1,73 @@
-Command: FreeFont FreeFont fonthandle Definition:
Deletes a previously loaded font and frees its memory.
Parameter Description:
fontname = string containing font name
-height = font height desired
-bold = set to TRUE to load font as BOLD
-italic = set to TRUE to load font as ITALIC
-underlined set to TRUE to load font as UNDERLINED
-
Command Description:
This removes a TrueType font previously loaded into memory (though the LoadFont command).
+
+
+Blitz3D Docs
+
+
+
+
FreeFont fonthandle
+
Parameters
+
+
+
+fonthandle = A handle to a previously loaded font.
+
+
+
+
Description
+
+
+
+This removes a TrueType font previously loaded into memory (though the LoadFont command).
+
+Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
+
+; LoadFont/SetFont/FreeFont example
+
+; enable graphics mode
+Graphics 800,600,16
+
+; Set global on font variables
+Global fntArial,fntArialB,fntArialI,fntArialU
+
+;Load fonts to a file handle variables
+fntArial=LoadFont("Arial",24,False,False,False)
+fntArialB=LoadFont("Arial",18,True,False,False)
+fntArialI=LoadFont("Arial",32,False,True,False)
+fntArialU=LoadFont("Arial",14,False,False,True)
+
+; set the font and print text
+SetFont fntArial
+Text 400,0,"This is just plain Arial 24 point",True,False
+
+SetFont fntArialB
+Text 400,30,"This is bold Arial 18 point",True,False
+
+SetFont fntArialI
+Text 400,60,"This is italic Arial 32 point",True,False
+
+SetFont fntArialU
+Text 400,90,"This is underlined Arial 14 point",True,False
+
+; Standard 'wait for ESC' from user
+While Not KeyHit(1)
+Wend
+
+; Clear all the fonts from memory!
+FreeFont fntArial
+FreeFont fntArialB
+FreeFont fntArialI
+FreeFont fntArialU
+
+
+
-Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
-
-; enable graphics mode
-Graphics 800,600,16
-
-; Set global on font variables
-Global fntArial,fntArialB,fntArialI,fntArialU
-
-;Load fonts to a file handle variables
-fntArial=LoadFont("Arial",24,False,False,False)
-fntArialB=LoadFont("Arial",18,True,False,False)
-fntArialI=LoadFont("Arial",32,False,True,False)
-fntArialU=LoadFont("Arial",14,False,False,True)
-
-; set the font and print text
-SetFont fntArial
-Text 400,0,"This is just plain Arial 24 point",True,False
-
-SetFont fntArialB
-Text 400,30,"This is bold Arial 18 point",True,False
-
-SetFont fntArialI
-Text 400,60,"This is italic Arial 32 point",True,False
-
-SetFont fntArialU
-Text 400,90,"This is underlined Arial 14 point",True,False
-
-; Standard 'wait for ESC' from user
-While Not KeyHit(1)
-Wend
-
-; Clear all the fonts from memory!
-FreeFont fntArial
-FreeFont fntArialB
-FreeFont fntArialI
-FreeFont fntArialU
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FreeImage.htm b/_release/help/commands/2d_commands/FreeImage.htm
index 4221eaf..96cd99b 100644
--- a/_release/help/commands/2d_commands/FreeImage.htm
+++ b/_release/help/commands/2d_commands/FreeImage.htm
@@ -1,23 +1,61 @@
-Command: FreeImage FreeImage handle Definition:
Removes the designated image from memory.
Parameter Description:
handle=variable that holds the image handle of a previously loaded image
Command Description:
When you are done with an image, use this command to delete the image from memory and free up that memory for other use. Good housekeeping. Get in the habit!
Example:
; FreeImage command
+
+
+Blitz3D Docs
+
+
+
+
FreeImage handle
+
Parameters
+
+
+
+handle=variable that holds the image handle of a previously loaded image
+
+
+
+
Description
+
+
+
+When you are done with an image, use this command to delete the image from memory and free up that memory for other use. Good housekeeping. Get in the habit!
+
+Note that the variable to the Image is not reset to 0 upon using FreeImage, nor will any other variables pointing to the same Image. If you try to access the handle again, it will result in an error. It is good practice to set the handle to zero immediately after freeing the image, as you can then check whether an image has already been freed or not.
-; Global, as always, for graphics
-Global gfxPlayer
-; Enter graphics mode and start double buffering
-Graphics 640,480,16
-SetBuffer BackBuffer()
+See also: LoadImage, SaveImage.
+
+; FreeImage command
+
+; Global, as always, for graphics
+Global gfxPlayer
+
+; Enter graphics mode and start double buffering
+Graphics 640,480,16
+SetBuffer BackBuffer()
+
+; Load the image-assign the handle to gfxPlayer
+gfxPlayer=LoadImage("player.bmp")
+
+; draw the image at random until ESC pressed
+While Not KeyHit(1)
+Cls
+DrawImage gfxPlayer,Rnd(640),Rnd(480)
+Flip
+Wend
+
+; Erase the image from memory!
+FreeImage gfxPlayer
+
+
+
-; Load the image-assign the handle to gfxPlayer
-gfxPlayer=LoadImage("player.bmp")
+Index
-; draw the image at random until ESC pressed
-While Not KeyHit(1)
-Cls
-DrawImage gfxPlayer,Rnd(640),Rnd(480)
-Flip
-Wend
-
-; Erase the image from memory!
-FreeImage gfxPlayer
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FreeSound.htm b/_release/help/commands/2d_commands/FreeSound.htm
index ca907d8..6c13775 100644
--- a/_release/help/commands/2d_commands/FreeSound.htm
+++ b/_release/help/commands/2d_commands/FreeSound.htm
@@ -1,9 +1,43 @@
-Command: FreeSound FreeSound sound_variable Definition:
Delete the sound and free up the memory it was using.
Parameter Description:
sound_variable - and valid variable previously created with the LoadSound command.
Command Description:
When you are finished using a sound effect, you should free up the memory its using and delete the sound. This command will delete a sound instance variable created with the LoadSound command.
+
+
+Blitz3D Docs
+
+
+
+
FreeSound sound_variable
+
Parameters
+
+
+
+sound_variable - and valid variable previously created with the LoadSound command.
+
+
+
+
Description
+
+
+
+When you are finished using a sound effect, you should free up the memory its using and delete the sound. This command will delete a sound instance variable created with the LoadSound command.
+
+Why would you want to do this? Perhaps you have different sets of sounds for different levels of your game? Perhaps your music loop changes from level to level. You want to do the RIGHT thing and manage your own resources. Just because you CAN load every sample for the whole game at once, consider someone that doesn't have as much memory as you do. You want to ensure that your game appeals to the widest audience possible. Note: You don't have to manually free these resources when your program terminates - Blitz does this automatically.
+
+; Load a sound into memory
+sndOneUp=LoadSound("audio1up.wav")
+
+; Free the memory up and delete the sound
+FreeSound sndOneUp
+
+
+
+
-Why would you want to do this? Perhaps you have different sets of sounds for different levels of your game? Perhaps your music loop changes from level to level. You want to do the RIGHT thing and manage your own resources. Just because you CAN load every sample for the whole game at once, consider someone that doesn't have as much memory as you do. You want to ensure that your game appeals to the widest audience possible. Note: You don't have to manually free these resources when your program terminates - Blitz does this automatically.
Example:
; Load a sound into memory
-sndOneUp=LoadSound("audio\1up.wav")
+Index
-; Free the memory up and delete the sound
-FreeSound sndOneUp
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FreeTimer.htm b/_release/help/commands/2d_commands/FreeTimer.htm
index 6254e55..b7a9020 100644
--- a/_release/help/commands/2d_commands/FreeTimer.htm
+++ b/_release/help/commands/2d_commands/FreeTimer.htm
@@ -1,15 +1,49 @@
-Command: FreeTimer FreeTimer (timer_variable) Definition:
Destroys the timer specified and frees up its memory.
Parameter Description:
timer = any valid timer variable created with the CreateTimer command.
Command Description:
This command will destroy a timer variable created with the with the CreateTimer command and free the memory it was using. It is a good practice to destroy elements in your game you are no longer using.
Example:
; Create the timer to track speed
-frameTimer=CreateTimer(60)
+
+
+Blitz3D Docs
+
+
+
+
FreeTimer (timer_variable)
+
Parameters
+
+
+
+timer = any valid timer variable created with the CreateTimer command.
+
+
+
+
Description
+
+
+
+This command will destroy a timer variable created with the with the CreateTimer command and free the memory it was using. It is a good practice to destroy elements in your game you are no longer using.
+
+; Create the timer to track speed
+frameTimer=CreateTimer(60)
+
+; Your main screen draw loop
+While Not KeyHit(1)
+WaitTimer(frameTimer) ; Pause until the timer reaches 60
+Cls
+; Draw your screen stuff
+Flip
+Wend
+
+; Kill the timer
+FreeTimer(frameTimer)
+
+
+
+
-; Your main screen draw loop
-While Not KeyHit(1)
-WaitTimer(frameTimer) ; Pause until the timer reaches 60
-Cls
-; Draw your screen stuff
-Flip
-Wend
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/FrontBuffer.htm b/_release/help/commands/2d_commands/FrontBuffer.htm
index 791c19b..ba76664 100644
--- a/_release/help/commands/2d_commands/FrontBuffer.htm
+++ b/_release/help/commands/2d_commands/FrontBuffer.htm
@@ -1,23 +1,57 @@
-Command: FrontBuffer() FrontBuffer() Definition:
Designates the front buffer as the drawing buffer.
Parameter Description:
None
Command Description:
Its important to understand buffers when writing a game.
+
+
+Blitz3D Docs
+
+
+
+
FrontBuffer()
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+It's important to understand buffers when writing a game.
+
+What the player can see at any given time is usually the front buffer. Anything you draw to this buffer is IMMEDIATELY visible to the player. This sounds fast (and it is) but the problem is that when you are drawing to the front buffer - like a piece of paper and pencil - anything you draw on the screen overwrites anything else that exists in the same space. So, if you want to 'save' any portion of the screen from being overwritten by another drawing operation, YOU - the programmer - have to copy the area 'under' the location of the new operation to an image so you can replace it later. Imagine taking a piece of paper with a picture of some mountains, and making an airplane pass in front of them, inch by inch. Every time the plane moves, you have to draw the new area that will be under the plane next on another sheet of paper (so you know what it looked like) then draw the plane over the new place. Next time you move, you will repeat this, then draw the image back in the OLD plane location. This process is labor-intensive and largely unnecessary thanks to a process called DOUBLE BUFFERING (see BackBuffer(). Double buffering is used for pretty much all games for high-action with lots of objects on the screen.
+
+So, if double buffering rocks so much, why would you WANT to ever draw to the front buffer? Sometimes, you just want to draw stuff to the screen, without caring what you overwrite. You don't have to worry about redrawing the screen over and over again in double buffering in this case. Just set the buffer to FrontBuffer() and you can write directly to the screen in real time.
+
+; FrontBuffer()/Rect Example
+
+; Engage graphics mode
+Graphics 640,480,16
+
+; Set the drawing buffer to front - instant drawing ops!
+SetBuffer FrontBuffer()
+
+; Repeat this until user presses ESC
+While Not KeyHit(1)
+; Set a random color
+Color Rnd(255),Rnd(255),Rnd(255)
+; Draw a rectangle at a random location, with a random width and height
+; plus randomly choose if the rectangle is solid or just an outline
+Rect Rnd(640),Rnd(480),Rnd(50),Rnd(50),Rnd(0,1)
+; Blitz is so dang fast, we need a delay so you can watch it draw!
+Delay 10
+Wend
+
+
+
-What the player can see at any given time is usually the front buffer. Anything you draw to this buffer is IMMEDIATELY visible to the player. This sounds fast (and it is) but the problem is that when you are drawing to the front buffer - like a piece of paper and pencil - anything you draw on the screen overwrites anything else that exists in the same space. So, if you want to 'save' any portion of the screen from being overwritten by another drawing operation, YOU - the programmer - have to copy the area 'under' the location of the new operation to an image so you can replace it later. Imagine taking a piece of paper with a picture of some mountains, and making an airplane pass in front of them, inch by inch. Every time the plane moves, you have to draw the new area that will be under the plane next on another sheet of paper (so you know what it looked like) then draw the plane over the new place. Next time you move, you will repeat this, then draw the image back in the OLD plane location. This process is labor-intensive and largely unnecessary thanks to a process called DOUBLE BUFFERING (see BackBuffer(). Double buffering is used for pretty much all games for high-action with lots of objects on the screen.
+Index
-So, if double buffering rocks so much, why would you WANT to ever draw to the front buffer? Sometimes, you just want to draw crap to the screen, without caring what you overwrite. You don't have to worry about redrawing the screen over and over again in double buffering in this case. Just set the buffer to FrontBuffer() and you can write directly to the screen in real time.
Example:
; FrontBuffer()/Rect Example
-
-; Engage graphics mode
-Graphics 640,480,16
-
-; Set the drawing buffer to front - instant drawing ops!
-SetBuffer FrontBuffer()
-
-; Repeat this until user presses ESC
-While Not KeyHit(1)
-; Set a random color
-Color Rnd(255),Rnd(255),Rnd(255)
-; Draw a rectangle at a random location, with a random width and height
-; plus randomly choose if the rectangle is solid or just an outline
-Rect Rnd(640),Rnd(480),Rnd(50),Rnd(50),Rnd(0,1)
-; Blitz is so dang fast, we need a delay so you can watch it draw!
-Delay 10
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Function.htm b/_release/help/commands/2d_commands/Function.htm
index cb32080..607150e 100644
--- a/_release/help/commands/2d_commands/Function.htm
+++ b/_release/help/commands/2d_commands/Function.htm
@@ -1,47 +1,85 @@
-Command: Function Function name Definition:
Begins a standalone snippet of code that is callable from your program.
Parameter Description:
name = any valid name text that is not a keyword of Blitz.
Command Description:
A function is a routine of commands you may choose to call frequently within your program. Functions are considered 'proper' practice in this situation, instead of using GOSUB commands.
+
+
+Blitz3D Docs
+
+
+
+
Function name
+
Parameters
+
+
+
+name = any valid name text that is not a keyword of Blitz.
+
+
+
+
Description
+
+
+
+A function is a routine of commands you may choose to call frequently within your program. Functions are considered 'proper' practice in this situation, instead of using GOSUB commands.
+
+Functions are independant of your 'main code' and will only execute if they are called. They have their own namespace, and variables created outside a function are NOT available within the function (this goes for TYPE structures as well) unless you declare the variable or Type structure as GLOBAL.
+
+You can pass variables into functions, as well as RETURN values back to the calling code. To return floats or strings from a function ensure your function name has a # or $ suffix.
+
+The practical use of functions is to help seperate your code into managable chunks for subsequent perfection of a routine. You may put all your screen updates into a single function, for example. Or perhaps your scoring system where you pass it what alien has been destroyed and it updates the player's score.
+
+Once the function reaches the END FUNCTION command, it returns program execution to the point immediately following the function call.
+
+Functions can be a bit daunting until you realize they really are their own little programs within your program. See the example for more.
+
+Note that if you want to be really clever, you can replace Blitz functions with your own function. This can be useful if you wish to add some error handling or additional processing around every instance of a Blitz function. Note that once you have replaced a Blitz function, you cannot call the real function - for example you cannot wrap a LoadImage command within a LoadImage function as it will recursively call itself!
-Functions are independant of your 'main code' and will only execute if they are called. They have their own namespace, and variables created outside a function are NOT available within the function (this goes for TYPE structures as well) unless you declare the variable or Type structure as GLOBAL.
+; Function Example
+
+; Get the user's name
+name$=Input$("Enter Your Name:")
+
+; Call a function to print how many letters the name has
+numletters(name$);
+
+; Let's get something BACK from the function
+thefirst$=firstletter(name$)
+
+; Now print results
+Print "Was the first letter an 'S'? (1=True/0=False)" + thefirst$
+
+;The program basically ends here, because functions don't run unless called.
+
+; The actual function
+Function numletters(passedname$)
+Print "Your name has " + Len(passedname$) + " letters in it."
+End Function
+
+; Function to see if the first letter is S
+Function firstletter(passedname$)
+
+; If the first letter is an 'S' then return from the function a true value
+If Left$(passedname$,1) = "S" Then
+Return True
+
+; Otherwise, return false
+Else
+
+Return False
+
+End If
+End Function
+
+
+
-The practical use of functions is to help seperate your code into managable chunks for subsequent perfection of a routine. You may put all your screen updates into a single function, for example. Or perhaps your scoring system where you pass it what alien has been destroyed and it updates the player's score.
+Index
-Once the function reaches the END FUNCTION command, it returns program execution to the next line following the function call.
-
-Functions can be a bit daunting until you realize they really are their own little programs within your program. See the example for more.
Example:
; Function Example
-
-; Get the user's name
-name$=Input$("Enter Your Name:")
-
-; Call a function to print how many letters the name has
-numletters(name$);
-
-; Let's get something BACK from the function
-thefirst$=firstletter(name$)
-
-; Now print results
-Print "Was the first letter an 'S'? (1=True/0=False)" + thefirst$
-
-;The program basically ends here, because functions don't run unless called.
-
-; The actual function
-Function numletters(passedname$)
-Print "Your name has " + Len(passedname$) + " letters in it."
-End Function
-
-; Function to see if the first letter is S
-Function firstletter(passedname$)
-
-; If the first letter is an 'S' then return from the function a true value
-If Left$(passedname$,1) = "S" Then
-Return True
-
-; Otherwise, return false
-Else
-
-Return False
-
-End If
-End Function
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GFXModeDepth.htm b/_release/help/commands/2d_commands/GFXModeDepth.htm
index 57ceb1c..6f2440a 100644
--- a/_release/help/commands/2d_commands/GFXModeDepth.htm
+++ b/_release/help/commands/2d_commands/GFXModeDepth.htm
@@ -1,16 +1,49 @@
-Command: GFXModeDepth GFXModeDepth (mode) Definition:
Returns the color depth capability of the selected video mode.
Parameter Description:
None.
Command Description:
Once you determine the video modes available by the video card using CountGFXModes(), you can iterate through them and determine the width, height, and color depth capabilities of each mode.
+
+
+Blitz3D Docs
+
+
+
+
GFXModeDepth (mode)
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Once you determine the video modes available by the video card using CountGFXModes(), you can iterate through them and determine the width, height, and color depth capabilities of each mode. Use this command to get the color depth of the mode. Use the GFXModeWidth and GFXModeHeight to get the remaining parameters.
+
+; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+
+intModes=CountGfxModes()
+
+Print "There are " + intModes + "graphic modes available:"
+
+; Display all modes including width, height, and color depth
+For t = 1 To intModes
+Print "Mode " + t + ":
+Print "Width=" + GfxModeWidth(t)
+Print "Height=" + GfxModeHeight(t)
+Print "Height=" + GfxModeDepth(t)
+Next
-Use this command to get the color depth of the mode. Use the GFXModeWidth and GFXModeHeight to get the remaining parameters.
Example:
; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GFXModeHeight.htm b/_release/help/commands/2d_commands/GFXModeHeight.htm
index 81e5d02..c84870c 100644
--- a/_release/help/commands/2d_commands/GFXModeHeight.htm
+++ b/_release/help/commands/2d_commands/GFXModeHeight.htm
@@ -1,16 +1,49 @@
-Command: GFXModeHeight GFXModeHeight (mode) Definition:
Returns the height capability of the selected video mode.
Parameter Description:
None.
Command Description:
Once you determine the video modes available by the video card using CountGFXModes(), you can iterate through them and determine the width, height, and color depth capabilities of each mode.
+
+
+Blitz3D Docs
+
+
+
+
GFXModeHeight (mode)
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Once you determine the video modes available by the video card using CountGFXModes(), you can iterate through them and determine the width, height, and color depth capabilities of each mode. Use this command to get the height of the mode. Use the GFXModeWidth and GFXModeDepth to get the remaining parameters.
+
+; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+
+intModes=CountGfxModes()
+
+Print "There are " + intModes + "graphic modes available:"
+
+; Display all modes including width, height, and color depth
+For t = 1 To intModes
+Print "Mode " + t + ":
+Print "Width=" + GfxModeWidth(t)
+Print "Height=" + GfxModeHeight(t)
+Print "Height=" + GfxModeDepth(t)
+Next
-Use this command to get the height of the mode. Use the GFXModeWidth and GFXModeDepth to get the remaining parameters.
Example:
; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GFXModeWidth.htm b/_release/help/commands/2d_commands/GFXModeWidth.htm
index 1a3f730..919c96c 100644
--- a/_release/help/commands/2d_commands/GFXModeWidth.htm
+++ b/_release/help/commands/2d_commands/GFXModeWidth.htm
@@ -1,16 +1,49 @@
-Command: GFXModeWidth GFXModeWidth (mode) Definition:
Returns the width capability of the selected video mode.
Parameter Description:
None.
Command Description:
Once you determine the video modes available by the video card using CountGFXModes(), you can iterate through them and determine the width, height, and color depth capabilities of each mode.
+
+
+Blitz3D Docs
+
+
+
+
GFXModeWidth (mode)
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Once you determine the video modes available by the video card using CountGFXModes(), you can iterate through them and determine the width, height, and color depth capabilities of each mode. Use this command to get the width of the mode. Use the GFXModeHeight and GFXModeDepth to get the remaining parameters.
+
+; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+
+intModes=CountGfxModes()
+
+Print "There are " + intModes + "graphic modes available:"
+
+; Display all modes including width, height, and color depth
+For t = 1 To intModes
+Print "Mode " + t + ":
+Print "Width=" + GfxModeWidth(t)
+Print "Height=" + GfxModeHeight(t)
+Print "Height=" + GfxModeDepth(t)
+Next
-Use this command to get the width of the mode. Use the GFXModeHeight and GFXModeDepth to get the remaining parameters.
Example:
; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GetColor.htm b/_release/help/commands/2d_commands/GetColor.htm
index 70f7b46..bb511ec 100644
--- a/_release/help/commands/2d_commands/GetColor.htm
+++ b/_release/help/commands/2d_commands/GetColor.htm
@@ -1,19 +1,52 @@
-Command: GetColor GetColor x, y Definition:
Sets the current drawing color to the color of the pixel designated.
Parameter Description:
x = x coordinate of pixel
-y = y coordinate of pixel
-
Command Description:
This command works like a 'color picker' in your favorite paint program. By specifying
Example:
; GetColor Example
+
+
+Blitz3D Docs
+
+
+
+
GetColor x, y
+
Parameters
+
+
+
+x = x coordinate of pixel
+y = y coordinate of pixel
+
+
+
+
Description
+
+
+
+This command works like a 'color picker' in your favorite paint program. By specifying
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GetJoy.htm b/_release/help/commands/2d_commands/GetJoy.htm
index e7dcb4a..6390ea9 100644
--- a/_release/help/commands/2d_commands/GetJoy.htm
+++ b/_release/help/commands/2d_commands/GetJoy.htm
@@ -1,10 +1,44 @@
-Command: GetJoy GetJoy ([port]) Definition:
Checks to see if a joystick button has been pressed - returns the number of the button or 0 if no button is pressed.
Parameter Description:
port = optional joystick port to read
Command Description:
Unlike the other similar commands (JoyDown and JoyHit), this command doesn't need to know which button you are trying to test for. It looks for any joystick button, then returns the number the user pressed. Since you are polling all the buttons instead of just a specific one, this may be a tad less efficient than using JoyDown or JoyHit. Use this command in conjunction with Select/Case for maximum efficiency!
Example:
; GetJoy Example
+
+
+Blitz3D Docs
+
+
+
+
GetJoy ([port])
+
Parameters
+
+
+
+port = optional joystick port to read
+
+
+
+
Description
+
+
+
+Unlike the other similar commands (JoyDown and JoyHit), this command doesn't need to know which button you are trying to test for. It looks for any joystick button, then returns the number the user pressed. Since you are polling all the buttons instead of just a specific one, this may be a tad less efficient than using JoyDown or JoyHit. Use this command in conjunction with Select/Case for maximum efficiency!
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GetKey.htm b/_release/help/commands/2d_commands/GetKey.htm
index 6e47c6b..ea2dfd7 100644
--- a/_release/help/commands/2d_commands/GetKey.htm
+++ b/_release/help/commands/2d_commands/GetKey.htm
@@ -1,12 +1,45 @@
-Command: GetKey() GetKey() Definition:
Checks for a keypress and returns its ASCII value.
Parameter Description:
None
Command Description:
This command will check to see if a key has been pressed and will return its ASCII value. Not all keys have ASCII values - if you need to trap SHIFT, ALT, or other non-ASCII compliant key, try KeyHit or KeyDown.
+
+
+Blitz3D Docs
+
+
+
+
GetKey()
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+This command will check to see if a key has been pressed and will return its ASCII value. Not all keys have ASCII values - if you need to trap SHIFT, ALT, or other non-ASCII compliant key, try KeyHit or KeyDown.
+
+; GetKey Example
+
+Print "Please press any ASCII key ..."
+
+While Not value
+value=GetKey()
+Wend
+
+Print "You pressed key with an ASCII value of:" + value
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GetMouse.htm b/_release/help/commands/2d_commands/GetMouse.htm
index f7f542c..2813745 100644
--- a/_release/help/commands/2d_commands/GetMouse.htm
+++ b/_release/help/commands/2d_commands/GetMouse.htm
@@ -1,10 +1,44 @@
-Command: GetMouse() GetMouse() Definition:
Checks to see if a mouse button has been clicked - returns the number of the button or 0 if no button is clicked.
Parameter Description:
None.
Command Description:
Unlike the other similar commands (MouseDown and MouseHit), this command doesn't need to know which button you are trying to test for. It looks for any mouse button, then returns the number the user clicked. Since you are polling all the mouse buttons instead of just a specific one, this may be a tad less efficient than using MouseDown or MouseHit. Use this command in conjunction with Select/Case for maximum efficiency!
Example:
; GetMouse Example
+
+
+Blitz3D Docs
+
+
+
+
GetMouse()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Unlike the other similar commands (MouseDown and MouseHit), this command doesn't need to know which button you are trying to test for. It looks for any mouse button, then returns the number the user clicked. Since you are polling all the mouse buttons instead of just a specific one, this may be a tad less efficient than using MouseDown or MouseHit. Use this command in conjunction with Select/Case for maximum efficiency!
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GfxDriverName.htm b/_release/help/commands/2d_commands/GfxDriverName.htm
index 178965e..1a8fc8f 100644
--- a/_release/help/commands/2d_commands/GfxDriverName.htm
+++ b/_release/help/commands/2d_commands/GfxDriverName.htm
@@ -1,22 +1,57 @@
-Command: GfxDriverName$ GfxDriverName$ (index) Definition:
Returns the title of a graphic driver.
Parameter Description:
index = index number obtained with CountGfxDrivers command
Command Description:
Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card).
+
+
+Blitz3D Docs
+
+
+
+
GfxDriverName$ (index)
+
Parameters
+
+
+
+index = index number obtained with CountGfxDrivers command
+
+
+
+
Description
+
+
+
+Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card).
+
+Once you know how many drivers there are using CountGfxDrivers(), you can iterate through them with this command and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with SetGfxDriver.
+
+Normally, this won't be necessary with 2D programming.
+
+; GfxDriver Examples
+
+; Count how many drivers there are
+totalDrivers=CountGfxDrivers()
+Print "Choose a driver to use:"
+
+; Go through them all and print their names (most people will have only 1)
+For t = 1 To totalDrivers
+Print t+") " + GfxDriverName$(t)
+Next
+
+; Let the user choose one
+driver=Input("Enter Selection:")
+
+; Set the driver!
+SetGfxDriver driver
+Print "Your driver has been selected!"
+
+
+
+
-Once you know how many drivers there are using CountGfxDrivers(), you can iterate through them with this command and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with SetGfxDriver.
+Index
-Normally, this won't be necessary with 2D programming.
Example:
; GfxDriver Examples
-
-; Count how many drivers there are
-totalDrivers=CountGfxDrivers()
-Print "Choose a driver to use:"
-
-; Go through them all and print their names (most people will have only 1)
-For t = 1 To totalDrivers
-Print t+") " + GfxDriverName$(t)
-Next
-
-; Let the user choose one
-driver=Input("Enter Selection:")
-
-; Set the driver!
-SetGfxDriver driver
-Print "Your driver has been selected!"
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GfxModeExists.htm b/_release/help/commands/2d_commands/GfxModeExists.htm
index 022e431..6029840 100644
--- a/_release/help/commands/2d_commands/GfxModeExists.htm
+++ b/_release/help/commands/2d_commands/GfxModeExists.htm
@@ -1,17 +1,52 @@
-Command: GfxModeExists GfxModeExists (width,height,depth) Definition:
Checks to see if the designated graphic mode exists.
Parameter Description:
width = width, in pixels (i.e. 640)
-height = height, in pixels (i.e. 480)
-depth = color depth (i.e. 16, 24, 32)
Command Description:
Use this command to verify whether or not the user's video card can use this graphic mode. Returns TRUE if the mode exists, FALSE if not. If you want to know what mode number this mode is, use FindGFXMode.
Example:
; GFXModeExists example
+
+
+Blitz3D Docs
+
+
+
+
GfxModeExists (width,height,depth)
+
Parameters
+
+
+
+width = width, in pixels (i.e. 640)
+height = height, in pixels (i.e. 480)
+depth = color depth (i.e. 16, 24, 32)
+
+
+
+
Description
+
+
+
+Use this command to verify whether or not the user's video card can use this graphic mode. Returns TRUE if the mode exists, FALSE if not. If you want to know what mode number this mode is, use FindGFXMode.
+
+; GFXModeExists example
+
+; If there is a mode, tell user
+mode=GfxModeExists(800,800,16)
+
+If mode=1 Then
+Print "The mode you requested exists!"
+Else
+Print "Sorry, that mode doesn't exist."
+End If
+
+; Wait for ESC press from user
+While Not KeyHit(1)
+Wend
+
+
+
+
-; If there is a mode, tell user
-mode=GfxModeExists(800,800,16)
+Index
-If mode=1 Then
-Print "The mode you requested exists!"
-Else
-Print "Sorry, that mode doesn't exist."
-End If
-
-; Wait for ESC press from user
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Global.htm b/_release/help/commands/2d_commands/Global.htm
index 7ef4ed9..3206996 100644
--- a/_release/help/commands/2d_commands/Global.htm
+++ b/_release/help/commands/2d_commands/Global.htm
@@ -1,2 +1,40 @@
-Command: Global Global variable Definition:
Declares global variables for use with your program.
Parameter Description:
variable = any valid variable/TYPE name
Command Description:
There are two types of variables in Blitz Basic; local variables and global variables. Global variables can be utilized anywhere in your program (i.e. the main program look and all functions. Use global variables when you need to track a value across your entire program (player score, lives, etc. You can also define TYPEs as global as well.
Example:
Global player1score ; Declare player 1's score as global Global graph.Cursor ; Declare the Cursor TYPE as global
+There are two types of variables in Blitz Basic; local variables and global variables. Global variables can be utilized anywhere in your program (i.e. the main program look and all functions. Use global variables when you need to track a value across your entire program (player score, lives, etc). You can also define TYPEs as global as well.
+
+
+See also: Local, Dim, Const.
+
+Global player1score ; Declare player's score as global
+Global graph.Cursor ; Declare the Cursor TYPE as global
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Gosub.htm b/_release/help/commands/2d_commands/Gosub.htm
index 6857445..ee1f287 100644
--- a/_release/help/commands/2d_commands/Gosub.htm
+++ b/_release/help/commands/2d_commands/Gosub.htm
@@ -1,16 +1,52 @@
-Command: Gosub Gosub label Definition:
Branches execution of a program to a designated label with the intention of returning to the original calling code.
Parameter Description:
label = any valid exisiting label
Command Description:
This branches the flow of the program to a designated label, with the understanding that there will be a Return later on in the called code to resume execution of the program where the Gosub was called. With the use of Functions inside of Blitz, it isn't very practical to use Gosubs, but you may still find it useful. If you do not require the need to return execution back to the Gosub statement, you may use Goto instead. See the example.
Example:
Print "The program starts ..."
-Gosub label1
-Print "The Program ends ..."
+
+
+Blitz3D Docs
+
+
+
+
Gosub label
+
Parameters
+
+
+
+label = any valid exisiting label
+
+
+
+
Description
+
+
+
+This branches the flow of the program to a designated label, with the understanding that there will be a Return later on in the called code to resume execution of the program where the Gosub was called. With the use of Functions inside of Blitz, it isn't very practical to use Gosubs, but you may still find it useful. If you do not require the need to return execution back to the Gosub statement, you may use Goto instead. See the example.
-; wait for ESC key before ending
-While Not KeyHit(1)
-Wend
+Print "The program starts ..."
+Gosub label1
+Print "The Program ends ..."
+
+; wait for ESC key before ending
+While Not KeyHit(1)
+Wend
+
+End
+
+.label1
+Print "We could do all sorts of things in this part of the program..."
+Print "But, we'll just go back to the original code, instead ..."
+Return
+
+
+
-.label1
-Print "We could do all sorts of things in this part of the program..."
-Print "But, we'll just go back to the original code, instead ..."
-Return
-
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Goto.htm b/_release/help/commands/2d_commands/Goto.htm
index 7236f4e..75ceac3 100644
--- a/_release/help/commands/2d_commands/Goto.htm
+++ b/_release/help/commands/2d_commands/Goto.htm
@@ -1,13 +1,49 @@
-Command: Goto Goto label Definition:
Branches execution of a program to a designated label.
Parameter Description:
label = any valid exisiting label
Command Description:
This branches the flow of the program to a designated label. With the use of Functions inside of Blitz, it isn't very practical to use Gotos, but you may still find it useful. If you require the need to return execution back to the calling statement, you may use Gosub instead. See the example.
Example:
Print "The program starts ..."
-Goto label1
-Print "This line never gets printed .."
-End
+
+
+Blitz3D Docs
+
+
+
+
Goto label
+
Parameters
+
+
+
+label = any valid exisiting label
+
+
+
+
Description
+
+
+
+This branches the flow of the program to a designated label. With the use of Functions inside of Blitz, it isn't very practical to use Gotos, but you may still find it useful. If you require the need to return execution back to the calling statement, you may use Gosub instead. See the example.
-.label1
-Print "We just jumped here!"
-; wait for ESC key before ending
-While Not KeyHit(1)
-Wend
-
+Print "The program starts ..."
+Goto label1
+Print "This line never gets printed .."
+End
+
+.label1
+Print "We just jumped here!"
+
+; wait for ESC key before ending
+While Not KeyHit(1)
+Wend
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GrabImage.htm b/_release/help/commands/2d_commands/GrabImage.htm
index 6f4bb50..25afd32 100644
--- a/_release/help/commands/2d_commands/GrabImage.htm
+++ b/_release/help/commands/2d_commands/GrabImage.htm
@@ -1,47 +1,82 @@
-Command: GrabImage GrabImage image,x,y,[frame] Definition:
Grabs a portion of the current drawing buffer and sticks it into an image.
Parameter Description:
image = variable of image handle
-x = starting x location to grab
-y = starting y location to grab
-frame = optional frame to insert the grabbed image into
Command Description:
Quite possibly one of the most useful yet underdocumented, confusing commands in the Blitz Basic language is GrabImage.
+
+
+Blitz3D Docs
+
+
+
+
GrabImage image,x,y,[frame]
+
Parameters
+
+
+
+image = variable of image handle
+x = starting x location to grab
+y = starting y location to grab
+frame = optional frame to insert the grabbed image into
+
+
+
+
Description
+
+
+
+Quite possibly one of the most useful yet underdocumented, confusing commands in the Blitz Basic language is GrabImage.
+
+This command allows you to grab a portion of the current drawing buffer (this could be an image too if you've set it as an ImageBuffer) and stick it into an image.
+
+There are a million and one uses for this command, so I'll let you use your imagination. However, the command doesn't make much sense as it is documented, so let me clarify.
+
+First, you must use CreateImage to create a new blank image in which to grab to. Whatever size you create the image, THAT is how much of the buffer will be grabbed from the x,y location you specify in GrabImage.
+
+For example, you create a new image with a size of 50 pixels by 50 pixels. When you call GrabImage, you choose x=100, y=100. The area you will grab and put into your new image will be 100,100 to 150,150. If you attempt to GrabImage into an image variable that hasn't been created yet, you will get an error.
+
+Note: You can REPLACE an existing image with a grabbed one.
+
+See the example for a more practical look.
+
+; GrabImage example
+
+; Turn on graphics
+Graphics 640,480,16
+
+; We'll be drawing right to the front buffer
+SetBuffer FrontBuffer()
+
+; You must create an empty image to grab from first
+gfxGrab=CreateImage(100,100)
+
+; Draw random rectangles on the screen until the
+; user presses ESC
+While Not KeyHit(1)
+; random color
+Color Rnd(255),Rnd(255),Rnd(255)
+; super random rectangles
+Rect Rnd(640),Rnd(480),Rnd(100),Rnd(100),Rnd(1)
+Delay 50
+Wend
+
+; Now, grab an image, starting at 100,100 and put it in gfxGrab
+GrabImage gfxGrab,100,100
+
+; Clear screen and show user the grabbed image
+Cls
+Text 0,0, "Here is your grabbed image! Press a mouse key ..."
+DrawImage gfxgrab,50,50
+
+; Wait for a mouse press
+WaitMouse()
+
+
+
+
-This command allows you to grab a portion of the current drawing buffer (this could be an image too if you've set it as an ImageBuffer) and stick it into an image.
+Index
-There are a million and one uses for this command, so I'll let you use your imagination. However, the command doesn't make much sense as it is documented, so let me clarify.
-
-First, you must use CreateImage to create a new blank image in which to grab to. Whatever size you create the image, THAT is how much of the buffer will be grabbed from the x,y location you specify in GrabImage.
-
-For example, you create a new image with a size of 50 pixels by 50 pixels. When you call GrabImage, you choose x=100, y=100. The area you will grab and put into your new image will be 100,100 to 150,150. If you attempt to GrabImage into an image variable that hasn't been created yet, you will get an error.
-
-Note: You can REPLACE an existing image with a grabbed one.
-
-See the example for a more practical look.
Example:
; GrabImage example
-
-; Turn on graphics
-Graphics 640,480,16
-
-; We'll be drawing right to the front buffer
-SetBuffer FrontBuffer()
-
-; You must create an empty image to grab from first
-gfxGrab=CreateImage(100,100)
-
-; Draw random rectangles on the screen until the
-; user presses ESC
-While Not KeyHit(1)
-; random color
-Color Rnd(255),Rnd(255),Rnd(255)
-; super random rectangles
-Rect Rnd(640),Rnd(480),Rnd(100),Rnd(100),Rnd(1)
-Delay 50
-Wend
-
-; Now, grab an image, starting at 100,100 and put it in gfxGrab
-GrabImage gfxGrab,100,100
-
-; Clear screen and show user the grabbed image
-Cls
-Text 0,0, "Here is your grabbed image! Press a mouse key ..."
-DrawImage gfxgrab,50,50
-
-; Wait for a mouse press
-WaitMouse()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Graphics.htm b/_release/help/commands/2d_commands/Graphics.htm
index 7861a8c..882c6c0 100644
--- a/_release/help/commands/2d_commands/Graphics.htm
+++ b/_release/help/commands/2d_commands/Graphics.htm
@@ -1,31 +1,67 @@
-Command: Graphics Graphics width, height, color depth,[mode] Definition:
Sets the graphics mode for the screen.
Parameter Description:
width = width of screen in pixels (640, 800, etc)
-height = height of screen in pixels (480, 600, etc)
-color depth = depth in bits (16, 24, or 32 bit - use 16 if possible!)
-mode = Video mode (see description); Optional
Command Description:
This command sets Blitz into 'graphics' mode with the specified width, height, and color depth (in bits). This command must be executed before any graphic related commands can be used. Color depth is OPTIONAL and should be left blank if possible - Blitz will determine the best color mode automatically for the user's video card.
+
+
+Blitz3D Docs
+
+
+
+
Graphics width, height, color depth,[mode]
+
Parameters
+
+
+
+width = width of screen in pixels (640, 800, etc)
+height = height of screen in pixels (480, 600, etc)
+color depth = depth in bits (0, 16, 24, or 32 bit)
+mode = Video mode (see description); Optional
+
+
+
+
Description
+
+
+
+This command sets Blitz into 'graphics' mode with the specified width, height, and color depth (in bits). This command must be executed before any graphic related commands can be used. Every time this command is used, any images loaded will be lost, and all handles to images will become invalid.
+
+Color depth is OPTIONAL and should be left blank or set to zero if possible - Blitz will then determine the best color mode automatically for the user's video card. In general 16 bit should be sufficient for most games and should be used wherever possible to ensure greatest compatibility.
+
+Valid graphic width and height varies GREATLY from card to card so to be sure your users can display the mode you wish, use the GfxModeExists command to be sure before you try and set the mode yourself. Common resolutions that are probably safe are 640x480 and 800x600. Try to avoid odd screen modes like 640x400 as MANY MANY cards cannot display them. Chances are if you can set your Windows screen resolution to a particular resolution, then Blitz will behave in that resolution also.
+
+Remember, each step higher in resolution and color depth mark a large jump in system requirements and may be inversely proportionate to system performance. If you use the lowest resolution and depth possible to meet your desired game parameters, it will allow more people with lesser systems than your own still play and enjoy your game. This is why many games still support a 640x480 mode :)
+
+An extra parameter is used at the end of the command after the color depth. Here are the parameters:
+
+0 : auto - windowed in debug, fullscreen in non-debug (this is the default)
+1 : fullscreen mode
+2 : windowed mode
+3 : scaled window mode
-Valid graphic width and height varies GREATLY from card to card so to be sure your users can display the mode you wish, use the GfxModeExists command to be sure before you try and set the mode yourself. Common resolutions that are probably safe are 640x480 and 800x600. Try to avoid odd screen modes like 640x400 as MANY MANY cards cannot display them. Chances are if you can set your Windows screen resolution to a particular resolution, then Blitz will behave in that resolution also.
-Remember, each step higher in resolution and color depth mark a large jump in system requirements and may be inversely proportionate to system performance. If you use the lowest resolution and depth possible to meet your desired game parameters, it will allow more people with lesser systems than your own still play and enjoy your game. This is why many games still support a 640x480 mode :)
+See also: EndGraphics, Graphics3D.
+
+;GRAPHICS Example
+
+; Set The Graphic Mode
+Graphics 800,600
+
+; Now print something on the graphic screen
+Text 0,0, "This is some text printed on the graphic screen (and a white box)! Press ESC ..."
+
+; Now for a box
+Rect 100,100,200,200,1
+
+While Not KeyHit(1)
+Wend
+
+
+
-An extra parameter is used at the end of the command after the color depth. Here are the parameters:
+Index
-0 : auto - windowed in debug, fullscreen in non-debug (this is the default)
-1 : fullscreen mode
-2 : windowed mode
-3 : scaled window mode
-
-
Example:
;GRAPHICS Example
-
-; Set The Graphic Mode
-Graphics 800,600
-
-; Now print something on the graphic screen
-Text 0,0, "This is some text printed on the graphic screen (and a white box)! Press ESC ..."
-
-; Now for a box
-Rect 100,100,200,200,1
-
-While Not KeyHit(1)
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GraphicsBuffer.htm b/_release/help/commands/2d_commands/GraphicsBuffer.htm
index 935d5b0..d1435a4 100644
--- a/_release/help/commands/2d_commands/GraphicsBuffer.htm
+++ b/_release/help/commands/2d_commands/GraphicsBuffer.htm
@@ -1,16 +1,51 @@
-Command: GraphicsBuffer() GraphicsBuffer() Definition:
Returns the handle of the current graphics buffer.
Parameter Description:
None
Command Description:
Use this command to get which buffer Blitz is currently writing to.
+; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+
+; Set a graphics mode and buffer
+Graphics 640,480,16
+SetBuffer FrontBuffer()
+
+; Print the details
+Print "Screen width is: " + GraphicsWidth()
+Print "Screen height is: " + GraphicsHeight()
+Print "Screen color depth is: " + GraphicsDepth()
+Print "Current buffer handle is: " + GraphicsBuffer()
+
+; Wait for ESC before exiting
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Set a graphics mode and buffer
-Graphics 640,480,16
-SetBuffer FrontBuffer()
+Index
-; Print the details
-Print "Screen width is: " + GraphicsWidth()
-Print "Screen height is: " + GraphicsHeight()
-Print "Screen color depth is: " + GraphicsDepth()
-Print "Current buffer handle is: " + GraphicsBuffer()
-
-; Wait for ESC before exiting
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GraphicsDepth.htm b/_release/help/commands/2d_commands/GraphicsDepth.htm
index 3afbaf2..3acae83 100644
--- a/_release/help/commands/2d_commands/GraphicsDepth.htm
+++ b/_release/help/commands/2d_commands/GraphicsDepth.htm
@@ -1,16 +1,51 @@
-Command: GraphicsDepth() GraphicsDepth() Definition:
Returns the color depth of the current graphics mode.
Parameter Description:
None
Command Description:
This command will tell you the color depth of the current graphics mode.
+; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+
+; Set a graphics mode and buffer
+Graphics 640,480,16
+SetBuffer FrontBuffer()
+
+; Print the details
+Print "Screen width is: " + GraphicsWidth()
+Print "Screen height is: " + GraphicsHeight()
+Print "Screen color depth is: " + GraphicsDepth()
+Print "Current buffer handle is: " + GraphicsBuffer()
+
+; Wait for ESC before exiting
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Set a graphics mode and buffer
-Graphics 640,480,16
-SetBuffer FrontBuffer()
+Index
-; Print the details
-Print "Screen width is: " + GraphicsWidth()
-Print "Screen height is: " + GraphicsHeight()
-Print "Screen color depth is: " + GraphicsDepth()
-Print "Current buffer handle is: " + GraphicsBuffer()
-
-; Wait for ESC before exiting
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GraphicsHeight.htm b/_release/help/commands/2d_commands/GraphicsHeight.htm
index 1c0d1f3..3699602 100644
--- a/_release/help/commands/2d_commands/GraphicsHeight.htm
+++ b/_release/help/commands/2d_commands/GraphicsHeight.htm
@@ -1,16 +1,51 @@
-Command: GraphicsHeight() GraphicsHeight() Definition:
Returns the height, in pixels, of the current graphics mode.
Parameter Description:
None
Command Description:
This command will tell you the height, in pixels, of the current graphics mode.
+; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+
+; Set a graphics mode and buffer
+Graphics 640,480,16
+SetBuffer FrontBuffer()
+
+; Print the details
+Print "Screen width is: " + GraphicsWidth()
+Print "Screen height is: " + GraphicsHeight()
+Print "Screen color depth is: " + GraphicsDepth()
+Print "Current buffer handle is: " + GraphicsBuffer()
+
+; Wait for ESC before exiting
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Set a graphics mode and buffer
-Graphics 640,480,16
-SetBuffer FrontBuffer()
+Index
-; Print the details
-Print "Screen width is: " + GraphicsWidth()
-Print "Screen height is: " + GraphicsHeight()
-Print "Screen color depth is: " + GraphicsDepth()
-Print "Current buffer handle is: " + GraphicsBuffer()
-
-; Wait for ESC before exiting
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/GraphicsWidth.htm b/_release/help/commands/2d_commands/GraphicsWidth.htm
index e28d318..916ebfc 100644
--- a/_release/help/commands/2d_commands/GraphicsWidth.htm
+++ b/_release/help/commands/2d_commands/GraphicsWidth.htm
@@ -1,16 +1,51 @@
-Command: GraphicsWidth() GraphicsWidth() Definition:
Returns the width, in pixels, of the current graphics mode.
Parameter Description:
None
Command Description:
This command will tell you the width, in pixels, of the current graphics mode.
+; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+
+; Set a graphics mode and buffer
+Graphics 640,480,16
+SetBuffer FrontBuffer()
+
+; Print the details
+Print "Screen width is: " + GraphicsWidth()
+Print "Screen height is: " + GraphicsHeight()
+Print "Screen color depth is: " + GraphicsDepth()
+Print "Current buffer handle is: " + GraphicsBuffer()
+
+; Wait for ESC before exiting
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Set a graphics mode and buffer
-Graphics 640,480,16
-SetBuffer FrontBuffer()
+Index
-; Print the details
-Print "Screen width is: " + GraphicsWidth()
-Print "Screen height is: " + GraphicsHeight()
-Print "Screen color depth is: " + GraphicsDepth()
-Print "Current buffer handle is: " + GraphicsBuffer()
-
-; Wait for ESC before exiting
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/HandleImage.htm b/_release/help/commands/2d_commands/HandleImage.htm
index 2f784c5..fbd3ea9 100644
--- a/_release/help/commands/2d_commands/HandleImage.htm
+++ b/_release/help/commands/2d_commands/HandleImage.htm
@@ -1,19 +1,52 @@
-Command: HandleImage HandleImage image,x,y Definition:
Set a new handle location on an existing image.
Parameter Description:
image = variable holding the file handle to the image
-x = x location of the new image handle location
-y = y location of the new image handle location
Command Description:
When an image is loaded with LoadImage, the image handle (the location within the image where the image is 'drawn from') is always defaulted to the top left corner (coordinates 0,0). This means if you draw an image that is 50x50 pixels at screen location 200,200, the image will begin to be drawn at 200,200 and extend to 250,250.
-
-This command moves the image handle from the 0,0 coordinate of the image to the specified x and y location in the image.
+
+
+Blitz3D Docs
+
+
+
+
HandleImage image,x,y
+
Parameters
+
+
+
+image = variable holding the file handle to the image
+x = x location of the new image handle location
+y = y location of the new image handle location
+
+
+
+
Description
+
+
+
+When an image is loaded with LoadImage, the image handle (the location within the image where the image is 'drawn from') is always defaulted to the top left corner (coordinates 0,0). This means if you draw an image that is 50x50 pixels at screen location 200,200, the image will begin to be drawn at 200,200 and extend to 250,250.
+
+This command moves the image handle from the 0,0 coordinate of the image to the specified x and y location in the image. You can retrieve an image's current location handle using the ImageXHandle and ImageYHandle. Finally, you can make all images automatically load with the image handle set to middle using the AutoMidHandle command.
+
+Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See LoadImage for more information about file handles.
+
+Also See: MidHandle
+
+;HandleImage Example
+
+Graphics 800,600,16
+
+gfxPlayer=LoadImage("player.bmp")
+HandleImage gfxPlayer,20,20
+DrawImage gfxPlayer,0,0
+WaitKey
-You can retrieve an image's current location handle using the ImageXHandle and ImageYHandle. Finally, you can make all images automatically load with the image handle set to middle using the AutoMidHandle command.
+
+
+
-Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See LoadImage for more information about file handles.
-
-Also See: MidHandle
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Hex.htm b/_release/help/commands/2d_commands/Hex.htm
index 51a889f..d7be8b9 100644
--- a/_release/help/commands/2d_commands/Hex.htm
+++ b/_release/help/commands/2d_commands/Hex.htm
@@ -1,3 +1,38 @@
-Command: Hex$ Hex$ (integer) Definition:
Converts an integer value to a hexidecimal value.
Parameter Description:
integer = any valid integer or integer variable
Command Description:
Converts integer values into hexidecimal values. If you don't know what hex is, you don't need to know this command :)
Example:
intValue="64738"
-Print "The hexidecimal value of "+intValue+" is: " + hex$(intValue)
+intValue="64738"
+Print "The hexidecimal value of "+intValue+" is: " + hex$(intValue)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/HidePointer.htm b/_release/help/commands/2d_commands/HidePointer.htm
index 847d417..5f0b7c8 100644
--- a/_release/help/commands/2d_commands/HidePointer.htm
+++ b/_release/help/commands/2d_commands/HidePointer.htm
@@ -1,47 +1,59 @@
-Command: HidePointer
-
-
+Blitz3D Docs
+
-
-
-
HidePointer
-
-
-Parameters:
-
-
-
-
n/a
-
-
-
Description:
-
-
-
-
HidePointer is for use in windowed display modes, and simply hides the Windows pointer when it is moved over your game's window. You can bring it back via ShowPointer. It has no effect in full-screen modes.
-Graphics 640, 480, 0, 2
-
-HidePointer
-
-Print "Move pointer over window and press a key..."
-WaitKey
-
-ShowPointer
-
-Delay 1000
+
HidePointer
+
Parameters
+
+
+
+None.
-
+
-
+
Description
+
+
+
+HidePointer is for use in windowed display modes, and simply hides the Windows pointer when it is moved over your game's window. You can bring it back via ShowPointer. It has no effect in full-screen modes.
+
+
+See also: ShowPointer.
+
+; HidePointer / ShoPointer Example
+
+; draw a simple screen, cut in half by a white line
+Graphics 800,600,0,2
+Color 255,255,255
+Line 400,0,400,600
+Text 200,300,"ShowPointer",True,True
+Text 600,300,"HidePointer",True,True
+
+; and a simple loop in which we hide / show the pointer dependent on
+; which side of the screen the mouse is on!
+Repeat
+ If MouseX()<400 Then
+ ShowPointer
+ Else
+ HidePointer
+ End If
+ If KeyHit(1) Then Exit ; ESCAPE to exit
+Forever
+
+End ; bye!
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/HostNetGame.htm b/_release/help/commands/2d_commands/HostNetGame.htm
index 4f068e8..3d2b3f0 100644
--- a/_release/help/commands/2d_commands/HostNetGame.htm
+++ b/_release/help/commands/2d_commands/HostNetGame.htm
@@ -1,12 +1,47 @@
-Command: HostNetGame HostNetGame (gamename$) Definition:
Starts a hosted network game.
Parameter Description:
gamename$ = string value designating the game's name
Command Description:
This allows you to bypass the 'standard' networked game dialog box (normally using StartNetGame) and start a hosted game directly. A value of 2 is returned if the hosted game has started successfully.
Example:
; HostNetGame example
+
+
+Blitz3D Docs
+
+
+
+
HostNetGame (gamename$)
+
Parameters
+
+
+
+gamename$ = string value designating the game's name
+
+
+
+
Description
+
+
+
+This allows you to bypass the 'standard' networked game dialog box (normally using StartNetGame) and start a hosted game directly. A value of 2 is returned if the hosted game has started successfully.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/If.htm b/_release/help/commands/2d_commands/If.htm
index c585efe..c889d01 100644
--- a/_release/help/commands/2d_commands/If.htm
+++ b/_release/help/commands/2d_commands/If.htm
@@ -1,18 +1,54 @@
-Command: If If Definition:
Checks a condition and executes code if the condition is met.
Parameter Description:
None.
Command Description:
Use this to check the value of a variable or to see if a condition is true or false. The code between IF and END IF (or ENDIF) is executed if the condition is true. Using NOT, you can also act if the condition is NOT true - or use ELSE to perform a different set of commands than if the condition is met. Lastly, you can use 'nested' or multiple IFs through the use of ELSE IF (or ELSEIF) to do LOTS of condition checking. If you get too deep in condition checking, consider using SELECT structures instead.
Example:
; IF THEN Example
+
+
+Blitz3D Docs
+
+
+
+
If
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Use this to check the value of a variable or to see if a condition is true or false. The code between IF and END IF (or ENDIF) is executed if the condition is true. Using NOT, you can also act if the condition is NOT true - or use ELSE to perform a different set of commands than if the condition is met. Lastly, you can use 'nested' or multiple IFs through the use of ELSE IF (or ELSEIF) to do LOTS of condition checking. If you get too deep in condition checking, consider using SELECT structures instead.
-; Input the user's name
-name$=Input$("What is your name? ")
+; IF THEN Example
+
+; Input the user's name
+name$=Input$("What is your name? ")
+
+; Doesn't the person's name equal SHANE?
+If name$ = "Shane" Then
+
+ Print "You are recognized, Shane! Welcome!"
+
+Else
+
+ Print "Sorry, you don't belong here!"
+
+; End of the condition checking
+End If
+
+
+
-Print "You are recognized, Shane! Welcome!"
+Index
-Else
-
-Print "Sorry, you don't belong here!"
-
-; End of the condition checking
-End If
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageBuffer.htm b/_release/help/commands/2d_commands/ImageBuffer.htm
index 3400888..03700c9 100644
--- a/_release/help/commands/2d_commands/ImageBuffer.htm
+++ b/_release/help/commands/2d_commands/ImageBuffer.htm
@@ -1,42 +1,77 @@
-Command: ImageBuffer ImageBuffer (handle[,frame]) Definition:
Used to denote an image and frame to direct drawing operations to.
Parameter Description:
handle=variable holding the image's handle
-frame=optional frame to draw to if using an imagestrip image
Command Description:
There are 1000 reasons for this command. Simply put, you may want to 'draw' on an existing image you've loaded (LoadImage or LoadAnimImage) or created (CreateImage). You could, for example, have a blank wall graphic and you want to add 'graffiti' to it based on the user action (Jet Grind Radio baybeee! Sorry...). Instead of trying to draw a dozen images all over the wall, just use the SetBuffer command to denote the wall graphic as the 'target' buffer, and draw away! Next time you display that graphic (DrawImage), you will see your changes! This is a powerful command!
+handle=variable holding the image's handle
+frame=optional frame to draw to if using an imagestrip image
+
+
+
+
Description
+
+
+
+There are 1000 reasons for this command. Simply put, you may want to 'draw' on an existing image you've loaded (LoadImage or LoadAnimImage) or created (CreateImage). You could, for example, have a blank wall graphic and you want to add 'graffiti' to it based on the user action (Jet Grind Radio baybeee! Sorry...). Instead of trying to draw a dozen images all over the wall, just use the SetBuffer command to denote the wall graphic as the 'target' buffer, and draw away! Next time you display that graphic (DrawImage), you will see your changes! This is a powerful command!
+
+; CreateImage/TileImage/ImageBuffer example
+
+; Again, we'll use globals even tho we don't need them here
+; One variable for the graphic we'll create, one for a timer
+Global gfxStarfield, tmrScreen
+
+; Declare graphic mode
+Graphics 640,480,16
+
+; Create a blank image that is 320 pixels wide and 32 high with 10 frames of 32x32
+gfxStarfield=CreateImage(32,32,10)
+
+; loop through each frame of the graphic we just made
+For t = 0 To 9
+; Set the drawing buffer to the graphic frame so we can write on it
+SetBuffer ImageBuffer(gfxStarfield,t)
+; put 50 stars in the frame at random locations
+For y = 1 To 50
+Plot Rnd(32),Rnd(32)
+Next
+Next
+
+; Double buffer mode for smooth screen drawing
+SetBuffer BackBuffer()
+
+; Loop until ESC is pressed
+While Not KeyHit(1)
+
+; Only update the screen every 300 milliseconds. Change 300 for faster or
+; slower screen updates
+If MilliSecs() > tmrScreen+300 Then
+Cls ; clear the screen
+
+; Tile the screen with a random frame from our new graphic starting at
+; x=0 and y=0 location.
+TileImage gfxStarfield,0,0,Rnd(9)
+Flip ; Flip the screen into view
+tmrScreen=MilliSecs() ; reset the time
+End If
+Wend
+
+
+
+
-; Again, we'll use globals even tho we don't need them here
-; One variable for the graphic we'll create, one for a timer
-Global gfxStarfield, tmrScreen
+Index
-; Declare graphic mode
-Graphics 640,480,16
-
-; Create a blank image that is 320 pixels wide and 32 high with 10 frames of 32x32
-gfxStarfield=CreateImage(32,32,10)
-
-; loop through each frame of the graphic we just made
-For t = 0 To 9
-; Set the drawing buffer to the graphic frame so we can write on it
-SetBuffer ImageBuffer(gfxStarfield,t)
-; put 50 stars in the frame at random locations
-For y = 1 To 50
- Plot Rnd(32),Rnd(32)
-Next
-Next
-
-; Double buffer mode for smooth screen drawing
-SetBuffer BackBuffer()
-
-; Loop until ESC is pressed
-While Not KeyHit(1)
-
-; Only update the screen every 300 milliseconds. Change 300 for faster or
-; slower screen updates
-If MilliSecs() > tmrScreen+300 Then
-Cls ; clear the screen
-
-; Tile the screen with a random frame from our new graphic starting at
-; x=0 and y=0 location.
-TileImage gfxStarfield,0,0,Rnd(9)
-Flip ; Flip the screen into view
-tmrScreen=MilliSecs() ; reset the time
-End If
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageHeight.htm b/_release/help/commands/2d_commands/ImageHeight.htm
index 289f4f0..34ab5c0 100644
--- a/_release/help/commands/2d_commands/ImageHeight.htm
+++ b/_release/help/commands/2d_commands/ImageHeight.htm
@@ -1,20 +1,55 @@
-Command: ImageHeight ImageHeight (image handle) Definition:
Return the height of the designated image, in pixels.
Parameter Description:
image handle = variable assigned when the image was loaded
Command Description:
Use this command and ImageWidth to return the size of the given image (using the handle assigned when the image was loaded with LoadImage) in pixels.
+image handle = variable assigned when the image was loaded
+
+
+
+
Description
+
+
+
+Use this command and ImageWidth to return the size of the given image (using the handle assigned when the image was loaded with LoadImage) in pixels.
+
+; ImageHeight/ImageWidth Example
+
+; Global, as always, for graphics
+Global gfxPlayer
+
+; Enter graphics mode and start double buffering
+Graphics 640,480,16
+SetBuffer BackBuffer()
+
+; Load the image-assign the handle to gfxPlayer
+gfxPlayer=LoadImage("player.bmp")
+
+; Print the image dimensions
+Print "The image height is: " + ImageHeight(gfxPlayer)
+Print "The image width is: " + ImageWidth(gfxPlayer)
+
+; Wait until ESC is pressed so you can see the output
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Global, as always, for graphics
-Global gfxPlayer
+Index
-; Enter graphics mode and start double buffering
-Graphics 640,480,16
-SetBuffer BackBuffer()
-
-; Load the image-assign the handle to gfxPlayer
-gfxPlayer=LoadImage("player.bmp")
-
-; Print the image dimensions
-Print "The image height is: " + ImageHeight(gfxPlayer)
-Print "The image width is: " + ImageWidth(gfxPlayer)
-
-; Wait until ESC is pressed so you can see the output
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageRectCollide.htm b/_release/help/commands/2d_commands/ImageRectCollide.htm
index f1d6998..a074ec0 100644
--- a/_release/help/commands/2d_commands/ImageRectCollide.htm
+++ b/_release/help/commands/2d_commands/ImageRectCollide.htm
@@ -1,64 +1,99 @@
-Command: ImageRectCollide ImageRectCollide (image,x,y,frame,rect x,rect y,rect width,rect height) Definition:
Checks to see if an image and designated rectangle area have collided.
Parameter Description:
image = Image to test collision against
-x = image's x location
-y = image's y location
-frame = image's frame
-rect x = x location start of the rect to test
-rect y = y location start of the rect
-rect width = width of the rect
-rect height = height of the rect
Command Description:
There are many times when you need to see if an image has collided with (or is touching) a specific rectangular area of the screen. This command performs pixel perfect accurate collision detection between the image of your choice and a specified rectangle on the screen.
+
+
+Blitz3D Docs
+
+
+
+
+image = Image to test collision against
+x = image's x location
+y = image's y location
+frame = image's frame
+rect x = x location start of the rect to test
+rect y = y location start of the rect
+rect width = width of the rect
+rect height = height of the rect
+
+
+
+
Description
+
+
+
+There are many times when you need to see if an image has collided with (or is touching) a specific rectangular area of the screen. This command performs pixel perfect accurate collision detection between the image of your choice and a specified rectangle on the screen.
+
+The usefulness of this comes into play when you think of a game like Monkey Island - when you might have a backdrop on the screen showing a room that has items in it the player can interact with using a mouse pointer graphic. In some cases, the items on the screen you wish to interact with will be seperate (often animated or moving) images of their own. For this situation, you would be better off using ImagesCollide or ImagesOverlap to detect the collision between pointer graphic and the image.
+
+Howevever, should your program just need to detect a graphic (like a mouse pointer) over at a particular location/region of the screen (often called a 'hot spot'), this command works great!
+
+As with any collision in Blitz, you will need to know the PRECISE location of the graphic you wish to test collision with, as well as the x, y, width, and height of the screen area (rect) you wish to test.
+
+The example blatently uses graphics that are much smaller than their container to show you how accurate this command really is. The ImageRectOverlap example is identical to this one - and shows how inaccurate the overlapping method can be with graphics of this nature.
+
+; ImageRectCollide Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create new empty graphic to store our circle in
+gfxCircle=CreateImage(50,50)
+
+; Draw the circle image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+
+; Let's not forget to put the drawing buffer back!
+SetBuffer BackBuffer()
+Color 0,0,255
+
+; Locate our box to a random, visible screen location
+hotX=Rnd(50,610)
+hotY=Rnd(50,430)
+hotW=Rnd(20,100)
+hotH=Rnd(20,100)
+
+; Repeat the loop until we've had a collision
+Repeat
+; Attach our mouse to the circle to move it
+circleX=MouseX()
+circleY=MouseY()
+; Standard double buffer technique; clear screen first
+Cls
+; Draw our rectangle
+Rect hotX,hotY,hotW,hotH,0
+DrawImage gfxCircle,circleX,circleY
+; Standard double buffer technique; flip after all drawing is done
+Flip
+; We test the locations of our rectangle area and circle to see if they have pixel collided
+Until ImageRectCollide (gfxCircle,circleX,circleY,0,hotX,hotY,hotW,hotH)
+
+; Loop is over, we must've collided!
+Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
+; Can't see the text until we flip ..
+Flip
+; Wait for a mouse click
+WaitMouse()
+; End our graphics mode
+EndGraphics
+
+
+
+
-The usefulness of this comes into play when you think of a game like Monkey Island - when you might have a backdrop on the screen showing a room that has items in it the player can interact with using a mouse pointer graphic. In some cases, the items on the screen you wish to interact with will be seperate (often animated or moving) images of their own. For this situation, you would be better off using ImagesCollide or ImagesOverlap to detect the collision between pointer graphic and the image.
+Index
-Howevever, should your program just need to detect a graphic (like a mouse pointer) over at a particular location/region of the screen (often called a 'hot spot'), this command works great!
-
-As with any collision in Blitz, you will need to know the PRECISE location of the graphic you wish to test collision with, as well as the x, y, width, and height of the screen area (rect) you wish to test.
-
-The example blatently uses graphics that are much smaller than their container to show you how accurate this command really is. The ImageRectOverlap example is identical to this one - and shows how inaccurate the overlapping method can be with graphics of this nature.
Example:
; ImageRectCollide Example
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Create new empty graphic to store our circle in
-gfxCircle=CreateImage(50,50)
-
-; Draw the circle image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-
-; Let's not forget to put the drawing buffer back!
-SetBuffer BackBuffer()
-Color 0,0,255
-
-; Locate our box to a random, visible screen location
-hotX=Rnd(50,610)
-hotY=Rnd(50,430)
-hotW=Rnd(20,100)
-hotH=Rnd(20,100)
-
-; Repeat the loop until we've had a collision
-Repeat
-; Attach our mouse to the circle to move it
-circleX=MouseX()
-circleY=MouseY()
-; Standard double buffer technique; clear screen first
-Cls
-; Draw our rectangle
-Rect hotX,hotY,hotW,hotH,0
-DrawImage gfxCircle,circleX,circleY
-; Standard double buffer technique; flip after all drawing is done
-Flip
-; We test the locations of our rectangle area and circle to see if they have pixel collided
-Until ImageRectCollide (gfxCircle,circleX,circleY,0,hotX,hotY,hotW,hotH)
-
-; Loop is over, we must've collided!
-Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
-; Can't see the text until we flip ..
-Flip
-; Wait for a mouse click
-WaitMouse()
-; End our graphics mode
-EndGraphics
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageRectOverlap.htm b/_release/help/commands/2d_commands/ImageRectOverlap.htm
index a192e3f..a7a47b9 100644
--- a/_release/help/commands/2d_commands/ImageRectOverlap.htm
+++ b/_release/help/commands/2d_commands/ImageRectOverlap.htm
@@ -1,63 +1,98 @@
-Command: ImageRectOverlap ImageRectOverlap (image,x,y,rect x,rect y,rect width,rect height) Definition:
Tests to see if an image and a rectangular screen area (rect) have overlapped.
Parameter Description:
image = Image to test collision against
-x = image's x location
-y = image's y location
-rect x = x location start of the rect to test
-rect y = y location start of the rect
-rect width = width of the rect
-rect height = height of the rect
Command Description:
There are many times when you need to see if an image has collided with (or is touching) a specific rectangular area of the screen. This command performs a collision detection between the image of your choice and a specified rectangle on the screen. Transparent pixels are ignored during the collision process, making this command a bit inaccurate for odd shaped graphics. See ImageRectCollide for pixel perfect collisions between an image and rectangular area of the screen.
+
+
+Blitz3D Docs
+
+
+
+
+image = Image to test collision against
+x = image's x location
+y = image's y location
+rect x = x location start of the rect to test
+rect y = y location start of the rect
+rect width = width of the rect
+rect height = height of the rect
+
+
+
+
Description
+
+
+
+There are many times when you need to see if an image has collided with (or is touching) a specific rectangular area of the screen. This command performs a collision detection between the image of your choice and a specified rectangle on the screen. Transparent pixels are ignored during the collision process, making this command a bit inaccurate for odd shaped graphics. See ImageRectCollide for pixel perfect collisions between an image and rectangular area of the screen.
+
+The usefulness of this comes into play when you think of a game like Monkey Island - when you might have a backdrop on the screen showing a room that has items in it the player can interact with using a mouse pointer graphic. In some cases, the items on the screen you wish to interact with will be seperate (often animated or moving) images of their own. For this situation, you would be better off using ImagesCollide or ImagesOverlap to detect the collision between pointer graphic and the image.
+
+Howevever, should your program just need to detect a graphic (like a mouse pointer) over at a particular location/region of the screen (often called a 'hot spot'), this command works great!
+
+As with any collision in Blitz, you will need to know the PRECISE location of the graphic you wish to test collision with, as well as the x, y, width, and height of the screen area (rect) you wish to test.
+
+The example blatently uses graphics that are much smaller than their container to show you how inaccurate this command can really be - if not used carefully. The ImageRectCollide example is identical to this one - and shows how accurate the pixel-perfect collision method can be with graphics of this nature.
+
+; ImageRectOverlap Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create new empty graphic to store our circle in
+gfxCircle=CreateImage(50,50)
+
+; Draw the circle image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+
+; Let's not forget to put the drawing buffer back!
+SetBuffer BackBuffer()
+Color 0,0,255
+
+; Locate our box to a random, visible screen location
+hotX=Rnd(50,610)
+hotY=Rnd(50,430)
+hotW=Rnd(20,100)
+hotH=Rnd(20,100)
+
+; Repeat the loop until we've had a collision
+Repeat
+; Attach our mouse to the circle to move it
+circleX=MouseX()
+circleY=MouseY()
+; Standard double buffer technique; clear screen first
+Cls
+; Draw our rectangle
+Rect hotX,hotY,hotW,hotH,0
+DrawImage gfxCircle,circleX,circleY
+; Standard double buffer technique; flip after all drawing is done
+Flip
+; We test the locations of our rectangle area and circle to see if they have overlapped
+Until ImageRectOverlap (gfxCircle,circleX,circleY,hotX,hotY,hotW,hotH)
+
+; Loop is over, we must've collided!
+Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
+; Can't see the text until we flip ..
+Flip
+; Wait for a mouse click
+WaitMouse()
+; End our graphics mode
+EndGraphics
+
+
+
+
-The usefulness of this comes into play when you think of a game like Monkey Island - when you might have a backdrop on the screen showing a room that has items in it the player can interact with using a mouse pointer graphic. In some cases, the items on the screen you wish to interact with will be seperate (often animated or moving) images of their own. For this situation, you would be better off using ImagesCollide or ImagesOverlap to detect the collision between pointer graphic and the image.
+Index
-Howevever, should your program just need to detect a graphic (like a mouse pointer) over at a particular location/region of the screen (often called a 'hot spot'), this command works great!
-
-As with any collision in Blitz, you will need to know the PRECISE location of the graphic you wish to test collision with, as well as the x, y, width, and height of the screen area (rect) you wish to test.
-
-The example blatently uses graphics that are much smaller than their container to show you how inaccurate this command can really be - if not used carefully. The ImageRectCollide example is identical to this one - and shows how accurate the pixel-perfect collision method can be with graphics of this nature.
Example:
; ImageRectOverlap Example
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Create new empty graphic to store our circle in
-gfxCircle=CreateImage(50,50)
-
-; Draw the circle image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-
-; Let's not forget to put the drawing buffer back!
-SetBuffer BackBuffer()
-Color 0,0,255
-
-; Locate our box to a random, visible screen location
-hotX=Rnd(50,610)
-hotY=Rnd(50,430)
-hotW=Rnd(20,100)
-hotH=Rnd(20,100)
-
-; Repeat the loop until we've had a collision
-Repeat
-; Attach our mouse to the circle to move it
-circleX=MouseX()
-circleY=MouseY()
-; Standard double buffer technique; clear screen first
-Cls
-; Draw our rectangle
-Rect hotX,hotY,hotW,hotH,0
-DrawImage gfxCircle,circleX,circleY
-; Standard double buffer technique; flip after all drawing is done
-Flip
-; We test the locations of our rectangle area and circle to see if they have overlapped
-Until ImageRectOverlap (gfxCircle,circleX,circleY,hotX,hotY,hotW,hotH)
-
-; Loop is over, we must've collided!
-Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
-; Can't see the text until we flip ..
-Flip
-; Wait for a mouse click
-WaitMouse()
-; End our graphics mode
-EndGraphics
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageWidth.htm b/_release/help/commands/2d_commands/ImageWidth.htm
index b1dedfd..9f1d8a8 100644
--- a/_release/help/commands/2d_commands/ImageWidth.htm
+++ b/_release/help/commands/2d_commands/ImageWidth.htm
@@ -1,20 +1,55 @@
-Command: ImageWidth ImageWidth (image handle) Definition:
Return the width of the designated image, in pixels.
Parameter Description:
image handle = variable assigned when the image was loaded
Command Description:
Use this command and ImageHeight to return the size of the given image (using the handle assigned when the image was loaded with LoadImage) in pixels.
+image handle = variable assigned when the image was loaded
+
+
+
+
Description
+
+
+
+Use this command and ImageHeight to return the size of the given image (using the handle assigned when the image was loaded with LoadImage) in pixels.
+
+; ImageHeight/ImageWidth Example
+
+; Global, as always, for graphics
+Global gfxPlayer
+
+; Enter graphics mode and start double buffering
+Graphics 640,480,16
+SetBuffer BackBuffer()
+
+; Load the image-assign the handle to gfxPlayer
+gfxPlayer=LoadImage("player.bmp")
+
+; Print the image dimensions
+Print "The image height is: " + ImageHeight(gfxPlayer)
+Print "The image width is: " + ImageWidth(gfxPlayer)
+
+; Wait until ESC is pressed so you can see the output
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Global, as always, for graphics
-Global gfxPlayer
+Index
-; Enter graphics mode and start double buffering
-Graphics 640,480,16
-SetBuffer BackBuffer()
-
-; Load the image-assign the handle to gfxPlayer
-gfxPlayer=LoadImage("player.bmp")
-
-; Print the image dimensions
-Print "The image height is: " + ImageHeight(gfxPlayer)
-Print "The image width is: " + ImageWidth(gfxPlayer)
-
-; Wait until ESC is pressed so you can see the output
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageXHandle.htm b/_release/help/commands/2d_commands/ImageXHandle.htm
index a72b8a8..c16177b 100644
--- a/_release/help/commands/2d_commands/ImageXHandle.htm
+++ b/_release/help/commands/2d_commands/ImageXHandle.htm
@@ -1,51 +1,84 @@
-Command: ImageXHandle ImageXHandle image Definition:
Returns the X location of the specified image's image handle.
Parameter Description:
image = variable holding the image's file handle
-
Command Description:
It is occasionally useful to determine the location of an image's image handle. This command returns the X coordinate. Use ImageYHandle to get the Y coordinate. Please see MidHandle for more information on the image's image handle.
+
+
+Blitz3D Docs
+
+
+
+
ImageXHandle image
+
Parameters
+
+
+
+image = variable holding the image's file handle
+
+
+
+
Description
+
+
+
+It is occasionally useful to determine the location of an image's image handle. This command returns the X coordinate. Use ImageYHandle to get the Y coordinate. Please see MidHandle for more information on the image's image handle.
+Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See LoadImage for more information about file handles.
+
+; MidHandle/ImageXHandle()/ImageYHandle()/AutoMidHandle
+
+; Initiate Graphics Mode
+Graphics 640,480,16
+
+; Set up the image file handle as a global
+Global gfxBall
+
+; Load the image - you may need to change the location of the file
+gfxBall=LoadImage ("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Until the user presses ESC key ...
+While Not KeyHit(1)
+Text 0,0,"Default Image Handle for gfxBall... Press ESC ..."
+Text 0,14,"X handle-" + ImageXHandle(gfxBall) ; Print the location of the image handle x location
+Text 0,28,"Y handle-" + ImageYHandle(gfxBall) ; Print the location of the image handle y location
+DrawImage gfxBall,200,200,0 ; draw the image at 200,200
+Wend
+
+; Clear the screen
+Cls
+
+; Set the ball's handle to the center of the image
+MidHandle gfxBall
+
+; Until the user presses ESC key ... show the new information
+While Not KeyHit(1)
+Text 0,0,"New Image Handle for gfxBall... Press ESC ..."
+Text 0,14,"X handle-" + ImageXHandle(gfxBall)
+Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
+DrawImage gfxBall,200,200,0
+Wend
+
+; Makes all images load up with their handles in the center of the image
+AutoMidHandle True
+Cls
+
+; Load the image again
+gfxBall=LoadImage ("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Until the user presses ESC key ... show the new information
+While Not KeyHit(1)
+Text 0,0,"Automatic image handle of gfxBall... Press ESC ..."
+Text 0,14,"X handle-" + ImageXHandle(gfxBall)
+Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
+DrawImage gfxBall,200,200,0
+Wend
+
+
+
+
-Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See LoadImage for more information about file handles.
-; Initiate Graphics Mode
-Graphics 640,480,16
-
-; Set up the image file handle as a global
-Global gfxBall
-
-; Load the image - you may need to change the location of the file
-gfxBall=LoadImage ("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Until the user presses ESC key ...
-While Not KeyHit(1)
-Text 0,0,"Default Image Handle for gfxBall... Press ESC ..."
-Text 0,14,"X handle-" + ImageXHandle(gfxBall) ; Print the location of the image handle x location
-Text 0,28,"Y handle-" + ImageYHandle(gfxBall) ; Print the location of the image handle y location
-DrawImage gfxBall,200,200,0 ; draw the image at 200,200
-Wend
-
-; Clear the screen
-Cls
-
-; Set the ball's handle to the center of the image
-MidHandle gfxBall
-
-; Until the user presses ESC key ... show the new information
-While Not KeyHit(1)
-Text 0,0,"New Image Handle for gfxBall... Press ESC ..."
-Text 0,14,"X handle-" + ImageXHandle(gfxBall)
-Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
-DrawImage gfxBall,200,200,0
-Wend
-
-; Makes all images load up with their handles in the center of the image
-AutoMidHandle True
-Cls
-
-; Load the image again
-gfxBall=LoadImage ("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Until the user presses ESC key ... show the new information
-While Not KeyHit(1)
-Text 0,0,"Automatic image handle of gfxBall... Press ESC ..."
-Text 0,14,"X handle-" + ImageXHandle(gfxBall)
-Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
-DrawImage gfxBall,200,200,0
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImageYHandle.htm b/_release/help/commands/2d_commands/ImageYHandle.htm
index 13a8beb..6f662d9 100644
--- a/_release/help/commands/2d_commands/ImageYHandle.htm
+++ b/_release/help/commands/2d_commands/ImageYHandle.htm
@@ -1,51 +1,84 @@
-Command: ImageYHandle ImageYHandle image Definition:
Returns the Y location of the specified image's image handle.
Parameter Description:
image = variable holding the image's file handle
-
Command Description:
It is occasionally useful to determine the location of an image's image handle. This command returns the Y coordinate. Use ImageXHandle to get the X coordinate. Please see MidHandle for more information on the image's image handle.
+
+
+Blitz3D Docs
+
+
+
+
ImageYHandle image
+
Parameters
+
+
+
+image = variable holding the image's file handle
+
+
+
+
Description
+
+
+
+It is occasionally useful to determine the location of an image's image handle. This command returns the Y coordinate. Use ImageXHandle to get the X coordinate. Please see MidHandle for more information on the image's image handle.
+Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See LoadImage for more information about file handles.
+
+; MidHandle/ImageXHandle()/ImageYHandle()/AutoMidHandle
+
+; Initiate Graphics Mode
+Graphics 640,480,16
+
+; Set up the image file handle as a global
+Global gfxBall
+
+; Load the image - you may need to change the location of the file
+gfxBall=LoadImage ("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Until the user presses ESC key ...
+While Not KeyHit(1)
+Text 0,0,"Default Image Handle for gfxBall... Press ESC ..."
+Text 0,14,"X handle-" + ImageXHandle(gfxBall) ; Print the location of the image handle x location
+Text 0,28,"Y handle-" + ImageYHandle(gfxBall) ; Print the location of the image handle y location
+DrawImage gfxBall,200,200,0 ; draw the image at 200,200
+Wend
+
+; Clear the screen
+Cls
+
+; Set the ball's handle to the center of the image
+MidHandle gfxBall
+
+; Until the user presses ESC key ... show the new information
+While Not KeyHit(1)
+Text 0,0,"New Image Handle for gfxBall... Press ESC ..."
+Text 0,14,"X handle-" + ImageXHandle(gfxBall)
+Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
+DrawImage gfxBall,200,200,0
+Wend
+
+; Makes all images load up with their handles in the center of the image
+AutoMidHandle True
+Cls
+
+; Load the image again
+gfxBall=LoadImage ("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Until the user presses ESC key ... show the new information
+While Not KeyHit(1)
+Text 0,0,"Automatic image handle of gfxBall... Press ESC ..."
+Text 0,14,"X handle-" + ImageXHandle(gfxBall)
+Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
+DrawImage gfxBall,200,200,0
+Wend
+
+
+
+
-Note about the term 'handle'. There are two types of 'handles' we discuss in these documents. One is the location within an image - as discussed in this command. The other is a 'file handle', a variable used to hold an image, sound, or font loaded with a command. See LoadImage for more information about file handles.
-; Initiate Graphics Mode
-Graphics 640,480,16
-
-; Set up the image file handle as a global
-Global gfxBall
-
-; Load the image - you may need to change the location of the file
-gfxBall=LoadImage ("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Until the user presses ESC key ...
-While Not KeyHit(1)
-Text 0,0,"Default Image Handle for gfxBall... Press ESC ..."
-Text 0,14,"X handle-" + ImageXHandle(gfxBall) ; Print the location of the image handle x location
-Text 0,28,"Y handle-" + ImageYHandle(gfxBall) ; Print the location of the image handle y location
-DrawImage gfxBall,200,200,0 ; draw the image at 200,200
-Wend
-
-; Clear the screen
-Cls
-
-; Set the ball's handle to the center of the image
-MidHandle gfxBall
-
-; Until the user presses ESC key ... show the new information
-While Not KeyHit(1)
-Text 0,0,"New Image Handle for gfxBall... Press ESC ..."
-Text 0,14,"X handle-" + ImageXHandle(gfxBall)
-Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
-DrawImage gfxBall,200,200,0
-Wend
-
-; Makes all images load up with their handles in the center of the image
-AutoMidHandle True
-Cls
-
-; Load the image again
-gfxBall=LoadImage ("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Until the user presses ESC key ... show the new information
-While Not KeyHit(1)
-Text 0,0,"Automatic image handle of gfxBall... Press ESC ..."
-Text 0,14,"X handle-" + ImageXHandle(gfxBall)
-Text 0,28,"Y handle-" + ImageYHandle(gfxBall)
-DrawImage gfxBall,200,200,0
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImagesCollide.htm b/_release/help/commands/2d_commands/ImagesCollide.htm
index 1f07ecc..0336a20 100644
--- a/_release/help/commands/2d_commands/ImagesCollide.htm
+++ b/_release/help/commands/2d_commands/ImagesCollide.htm
@@ -1,67 +1,102 @@
-Command: ImagesCollide ImagesCollide (image1,x1,y1,frame1,image2,x2,y2,frame2) Definition:
Checks to see if two images have collided.
Parameter Description:
image1 = first image to test
-x1 = image1's x location
-y1 = image1's y location
-frame1 = image1's frame to test (optional)
-image2 = second image to test
-x2 = image2's x location
-y2 = image2's y location
-frame2 = image2's frame to text (optional)
Command Description:
This is THE command to get pixel-perfect collisions between images. It will not consider transparent pixels during the collision check (basically, only the 'meat' of the image will invoke a collision). This makes it perfect for most situations where you have odd-shaped graphics to text against.
+
+
+Blitz3D Docs
+
+
+
+
+image1 - first image to test
+x1 - image1's x location
+y1 - image1's y location
+frame1 - image1's frame to test (optional)
+
+image2 - second image to test
+x2 - image2's x location
+y2 - image2's y location
+frame2 - image2's frame to test (optional)
+
+
+
+
Description
+
+
+
+This is THE command to get pixel-perfect collisions between images. It will not consider transparent pixels during the collision check (basically, only the 'meat' of the image will invoke a collision). This makes it perfect for most situations where you have odd-shaped graphics to text against.
+
+The ImagesOverlap command is MUCH faster, however, but can only determine if ANY of the two images have overlapped (this INCLUDES transparent pixels). This method works if you have graphics that completely fill their container and/or you don't plan on needing pinpoint accuracy.
+
+As with any collision detection system in Blitz, you will need to know the variable names of the two images, and their X and Y locations at the moment collision checking occurs.
+
+The example blatently uses graphics that are much smaller than their container to show you how accurate this command really is. The ImagesOverlap example is identical to this one - and shows how inaccurate the overlapping method can be with graphics of this nature.
+
+; ImagesCollide Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create two new empty graphics to store our circle and box in
+gfxBox=CreateImage(50,50)
+gfxCircle=CreateImage(50,50)
+
+; Draw the box image first
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxBox)
+; Change drawing color to blue
+Color 0,0,255
+;Draw our box (note that it has a 10 pixel space around it)
+Rect 10,10,30,30,1
+
+; Repeat for the circle graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+
+; Let's not forget to put the drawing buffer back!
+SetBuffer BackBuffer()
+
+; Locate our box to a random, visible screen location
+boxX=Rnd(50,610)
+boxY=Rnd(50,430)
+
+; Repeat the loop until we've had a collision
+Repeat
+; Attach our mouse to the circle to move it
+circleX=MouseX()
+circleY=MouseY()
+; Standard double buffer technique; clear screen first
+Cls
+; Draw our objects at the designated location
+DrawImage gfxBox,boxX,boxY
+DrawImage gfxCircle,circleX,circleY
+; Standard double buffer technique; flip after all drawing is done
+Flip
+; We test the locations of our box and circle to see if they have pixel collided
+Until ImagesCollide (gfxBox,boxX,boxY,0,gfxCircle,circleX,circleY,0)
+
+; Loop is over, we must've collided!
+Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
+; Can't see the text until we flip ..
+Flip
+; Wait for a mouse click
+WaitMouse()
+; End our graphics mode
+EndGraphics
+
+
+
-The ImagesOverlap command is MUCH faster, however, but can only determine if ANY of the two images have overlapped (this INCLUDES transparent pixels). This method works if you have graphics that completely fill their container and/or you don't plan on needing pinpoint accuracy.
+Index
-As with any collision detection system in Blitz, you will need to know the variable names of the two images, and their X and Y locations at the moment collision checking occurs.
-
-The example blatently uses graphics that are much smaller than their container to show you how accurate this command really is. The ImagesOverlap example is identical to this one - and shows how inaccurate the overlapping method can be with graphics of this nature.
Example:
; ImagesCollide Example
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Create two new empty graphics to store our circle and box in
-gfxBox=CreateImage(50,50)
-gfxCircle=CreateImage(50,50)
-
-; Draw the box image first
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxBox)
-; Change drawing color to blue
-Color 0,0,255
-;Draw our box (note that it has a 10 pixel space around it)
-Rect 10,10,30,30,1
-
-; Repeat for the circle graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-
-; Let's not forget to put the drawing buffer back!
-SetBuffer BackBuffer()
-
-; Locate our box to a random, visible screen location
-boxX=Rnd(50,610)
-boxY=Rnd(50,430)
-
-; Repeat the loop until we've had a collision
-Repeat
-; Attach our mouse to the circle to move it
-circleX=MouseX()
-circleY=MouseY()
-; Standard double buffer technique; clear screen first
-Cls
-; Draw our objects at the designated location
-DrawImage gfxBox,boxX,boxY
-DrawImage gfxCircle,circleX,circleY
-; Standard double buffer technique; flip after all drawing is done
-Flip
-; We test the locations of our box and circle to see if they have pixel collided
-Until ImagesCollide (gfxBox,boxX,boxY,0,gfxCircle,circleX,circleY,0)
-
-; Loop is over, we must've collided!
-Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
-; Can't see the text until we flip ..
-Flip
-; Wait for a mouse click
-WaitMouse()
-; End our graphics mode
-EndGraphics
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ImagesOverlap.htm b/_release/help/commands/2d_commands/ImagesOverlap.htm
index 6455316..e28e853 100644
--- a/_release/help/commands/2d_commands/ImagesOverlap.htm
+++ b/_release/help/commands/2d_commands/ImagesOverlap.htm
@@ -1,67 +1,102 @@
-Command: ImagesOverlap ImagesOverlap (image1,x1,y1,image2,x2,y2) Definition:
Checks to see if two graphic images have overlapped.
Parameter Description:
image1 = first image to test
-x1 = image1's x location
-y1 = image1's y location
-image2 = second image to test
-x2 = image2's x location
-y2 = image2's y location
Command Description:
This is a very fast, simple collision type command that will allow you to determine whether or not two images have overlapped each other. This does not take into account any transparent pixels (see ImagesCollide).
+
+
+Blitz3D Docs
+
+
+
+
ImagesOverlap (image1,x1,y1,image2,x2,y2)
+
Parameters
+
+
+
+image1 = first image to test
+x1 = image1's x location
+y1 = image1's y location
+image2 = second image to test
+x2 = image2's x location
+y2 = image2's y location
+
+
+
+
Description
+
+
+
+This is a very fast, simple collision type command that will allow you to determine whether or not two images have overlapped each other. This does not take into account any transparent pixels (see ImagesCollide).
+
+As with any collision detection system in Blitz, you will need to know the variable names of the two images, and their X and Y locations at the moment collision checking occurs.
+
+In many cases, you might be able to get away with using this more crude, yet quite fast method of collision detection. For games where your graphics are very squared off and pixel-perfect accuracy isn't a must, you can employ this command to do quick and dirty overlap checking.
+
+The example blatently uses graphics that are much smaller than their container to show you how inaccurate this command can be - if not used wisely. The ImagesCollide example is identical to this one - and shows how pixel-perfect collision works.
+
+You might be able to get away with this on some more classical games like Robotron, Defender, Dig Dug, etc.
+
+; ImagesOverlap Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Create two new empty graphics to store our circle and box in
+gfxBox=CreateImage(50,50)
+gfxCircle=CreateImage(50,50)
+
+; Draw the box image first
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxBox)
+; Change drawing color to blue
+Color 0,0,255
+;Draw our box (note that it has a 10 pixel space around it)
+Rect 10,10,30,30,1
+
+; Repeat for the circle graphic
+SetBuffer ImageBuffer(gfxCircle)
+Color 255,0,0
+; Note the extra space between the circle and the edge of the graphic
+Oval 10,10,30,30,1
+
+; Let's not forget to put the drawing buffer back!
+SetBuffer BackBuffer()
+
+; Locate our box to a random, visible screen location
+boxX=Rnd(50,610)
+boxY=Rnd(50,430)
+
+; Repeat the loop until we've had a collision
+Repeat
+; Attach our mouse to the circle to move it
+circleX=MouseX()
+circleY=MouseY()
+; Standard double buffer technique; clear screen first
+Cls
+; Draw our objects at the designated location
+DrawImage gfxBox,boxX,boxY
+DrawImage gfxCircle,circleX,circleY
+; Standard double buffer technique; flip after all drawing is done
+Flip
+; We test the locations of our box and circle to see if they have overlapped
+Until ImagesOverlap (gfxBox,boxX,boxY,gfxCircle,circleX,circleY)
+
+; Loop is over, we must've collided!
+Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
+; Can't see the text until we flip ..
+Flip
+; Wait for a mouse click
+WaitMouse()
+; End our graphics mode
+EndGraphics
+
+
+
+
-As with any collision detection system in Blitz, you will need to know the variable names of the two images, and their X and Y locations at the moment collision checking occurs.
+Index
-In many cases, you might be able to get away with using this more crude, yet quite fast method of collision detection. For games where your graphics are very squared off and pixel-perfect accuracy isn't a must, you can employ this command to do quick and dirty overlap checking.
-
-The example blatently uses graphics that are much smaller than their container to show you how inaccurate this command can be - if not used wisely. The ImagesCollide example is identical to this one - and shows how pixel-perfect collision works.
-
-You might be able to get away with this on some more classical games like Robotron, Defender, Dig Dug, etc.
Example:
; ImagesOverlap Example
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Create two new empty graphics to store our circle and box in
-gfxBox=CreateImage(50,50)
-gfxCircle=CreateImage(50,50)
-
-; Draw the box image first
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxBox)
-; Change drawing color to blue
-Color 0,0,255
-;Draw our box (note that it has a 10 pixel space around it)
-Rect 10,10,30,30,1
-
-; Repeat for the circle graphic
-SetBuffer ImageBuffer(gfxCircle)
-Color 255,0,0
-; Note the extra space between the circle and the edge of the graphic
-Oval 10,10,30,30,1
-
-; Let's not forget to put the drawing buffer back!
-SetBuffer BackBuffer()
-
-; Locate our box to a random, visible screen location
-boxX=Rnd(50,610)
-boxY=Rnd(50,430)
-
-; Repeat the loop until we've had a collision
-Repeat
-; Attach our mouse to the circle to move it
-circleX=MouseX()
-circleY=MouseY()
-; Standard double buffer technique; clear screen first
-Cls
-; Draw our objects at the designated location
-DrawImage gfxBox,boxX,boxY
-DrawImage gfxCircle,circleX,circleY
-; Standard double buffer technique; flip after all drawing is done
-Flip
-; We test the locations of our box and circle to see if they have overlapped
-Until ImagesOverlap (gfxBox,boxX,boxY,gfxCircle,circleX,circleY)
-
-; Loop is over, we must've collided!
-Text 0,0, "WE'VE HAD A COLLISION! PRESS A MOUSE BUTTON"
-; Can't see the text until we flip ..
-Flip
-; Wait for a mouse click
-WaitMouse()
-; End our graphics mode
-EndGraphics
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Include.htm b/_release/help/commands/2d_commands/Include.htm
index c3496ee..391eab5 100644
--- a/_release/help/commands/2d_commands/Include.htm
+++ b/_release/help/commands/2d_commands/Include.htm
@@ -1,17 +1,54 @@
-Command: Include Include filename Definition:
Includes more Blitz Basic source code into your code from an external file.
Parameter Description:
filename = full path and filename of your .bb include code
Command Description:
Includes are a cheap substitute for Function Folding (grin). Seriously, Includes offers the programmer a means of keeping distinct code seperate by taking 'working' subroutines, functions, variable assignments - heck, ANY code and placing it into an external .bb file. This external file can be 'included' into another Blitz program - and when you run the program, Blitz will 'included' that external code just as if it cut and pasted it right into your source code before it runs. For example, you could create a small Blitz program for displaying your 'intro' screen/effect and save it off as 'intro.bb'. Then, give it to all your programmers so they can 'include' that source code at the beginning of their game. Many programmers find it useful to write functions, test them, and once working 100% properly, save them off as their own source code and just include them in their main program. This keeps code segregated, readable, and modularly changeable.
+
+
+Blitz3D Docs
+
+
+
+
Include filename$
+
Parameters
+
+
+
+filename$ - name of .bb file to be 'Include(d)' in quotes.
+
+
+
+
Description
+
+
+
+Includes the contents of the specified .bb file in the current source code file.
+
+Useful for when you're code gets too big, or you just want to organise functions that you've finalised and functions that you're working on.
+
+The Include command effectively "cuts and pastes" the contents of the .bb file to be included into the current file at the point of the Include function call, temporarily, before being passed to the compiler to Execute.
+
+Note that each .bb file can only be included once.
+
+; Include Example
+; ---------------
+
+;include finished code files
+Include "include_globals.bb"
+Include "include_menu.bb"
+Include "include_game.bb"
+Include "include_music.bb"
+Include "include_sound.bb"
+Include "include_ai.bb"
+
+;Main program loop here
+;End program
+
+
+
-For debugging purposes, if you run a program with included files, and one of the includes has an error, Blitz will automagically load the include, and display the error/debug information there. Nice, huh?
+Index
-Hopefully Function Folding will be supported in future versions of Blitz, since many people use Includes to 'simulate' this feature.
-
-Note: The example only shows you the calling code using the INCLUDE command - it will not run unless you create the included files yourself.
Example:
; INCLUDE Example
-
-; Include the source code that has all our variables in it
-Include "myvariables.bb"
-
-; Get the TYPEs from an external source code include
-Include "myTYPES.bb"
-
-
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Input.htm b/_release/help/commands/2d_commands/Input.htm
index 0047f2b..4170a29 100644
--- a/_release/help/commands/2d_commands/Input.htm
+++ b/_release/help/commands/2d_commands/Input.htm
@@ -1,6 +1,40 @@
-Command: Input$ Input$ (prompt$) Definition:
Get input from the user.
Parameter Description:
prompt$ = any valid string (optional)
Command Description:
This command will retrieve a string value from the user with an optional prompt on the screen (if not in a graphic mode) or on the current drawing buffer being used by the program. Usually you will assign this command's value to a string for later use.
Example:
; Get the user's name and print a welcome
+
+
+Blitz3D Docs
+
+
+
+
Input$ (prompt$)
+
Parameters
+
+
+
+prompt$ = any valid string (optional)
+
+
+
+
Description
+
+
+
+This command will retrieve a string value from the user with an optional prompt on the screen (if not in a graphic mode) or on the current drawing buffer being used by the program. Usually you will assign this command's value to a string for later use.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Insert.htm b/_release/help/commands/2d_commands/Insert.htm
index 564f7d9..f4c0137 100644
--- a/_release/help/commands/2d_commands/Insert.htm
+++ b/_release/help/commands/2d_commands/Insert.htm
@@ -1,29 +1,64 @@
-Command: Insert Insert Definition:
Insert the current TYPE object into another location in the TYPE collection.
Parameter Description:
None.
Command Description:
I'm not sure the practical usage of this command, but basically, you can control where you INSERT the current TYPE object into the TYPE collection. When you create a new Type object with the NEW command, it is automatically appended to the END of the collection. Using INSERT along with BEFORE and AFTER (and electively FIRST and LAST) to put the Type object exactly where you want it. Sounds confusing - and chances are likely you'll never need this ability. But its here if you need it. Check the example.
Example:
; INSERT example
+
+
+Blitz3D Docs
+
+
+
+
Insert
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+I'm not sure the practical usage of this command, but basically, you can control where you INSERT the current TYPE object into the TYPE collection. When you create a new Type object with the NEW command, it is automatically appended to the END of the collection. Using INSERT along with BEFORE and AFTER (and electively FIRST and LAST) to put the Type object exactly where you want it. Sounds confusing - and chances are likely you'll never need this ability. But its here if you need it. Check the example.
-; Define a CHAIR type with a created field to track what order it was created in.
-Type CHAIR
-Field created
-End Type
-; Create 10 chairs, setting created field to the order of creation
-For t = 1 To 10
-room.chair= New Chair
-room\created = t
-Next
+See also: Type, New, Before, After, First, Last, Each, Delete.
+
+; INSERT example
+
+; Define a CHAIR type with a created field to track what order it was created in.
+Type CHAIR
+Field created
+End Type
+
+; Create 10 chairs, setting created field to the order of creation
+For t = 1 To 10
+room.chair= New Chair
+room\created = t
+Next
+
+; Make a NEW chair (the 11th)
+room.chair= New Chair
+
+; Set its created value to 11
+room\created=11
+
+; Now, let's insert this chair BEFORE the first one in the collection
+Insert room Before First Chair
+
+; Let's iterate through all the chairs, and show their creation order
+For room.chair = Each chair
+Print room\created
+Next
+
+
+
-; Make a NEW chair (the 11th)
-room.chair= New Chair
+Index
-; Set its created value to 11
-room\created=11
-
-; Now, let's insert this chair BEFORE the first one in the collection
-Insert room Before First Chair
-
-; Let's iterate through all the chairs, and show their creation order
-For room.chair = Each chair
-Print room\created
-Next
-
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Instr.htm b/_release/help/commands/2d_commands/Instr.htm
index fc0a98d..19404f4 100644
--- a/_release/help/commands/2d_commands/Instr.htm
+++ b/_release/help/commands/2d_commands/Instr.htm
@@ -1,7 +1,41 @@
-Command: Instr Instr (string1$, string2$, offset) Definition:
Finds the position of an occurance of one string within another.
Parameter Description:
string1$ = the string you wish to search
-string2$ = the string to find
-offset = valid integer starting position to being search (optional)
Command Description:
This command will allow you to search for an occurance of a string within another string. The command returns the location (number of characters from the left) of the string you are looking for. Command returns a Zero if no matches are found.
Example:
name$="Shane R. Monroe"
-location = Instr( name$,"R.",1)
-Print "Your string contains 'R.' at position number " + location + "!"
-
+string1$ = the string you wish to search
+string2$ = the string to find
+offset = valid integer starting position to being search (optional)
+
+
+
+
Description
+
+
+
+This command will allow you to search for an occurance of a string within another string. The command returns the location (number of characters from the left) of the string you are looking for. Command returns a Zero if no matches are found.
+
+name$="Shane R. Monroe"
+location = Instr( name$,"R.",1)
+Print "Your string contains 'R.' at position number " + location + "!"
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Int.htm b/_release/help/commands/2d_commands/Int.htm
index ed3b2c1..927f865 100644
--- a/_release/help/commands/2d_commands/Int.htm
+++ b/_release/help/commands/2d_commands/Int.htm
@@ -1,5 +1,107 @@
-Command: Int Int (value) Definition:
Returns the integer portion of a number.
Parameter Description:
value = any valid variable or number
Command Description:
Returns the integer value of an expression or value. Use this to convert a floating point number to a straight integer value. See Example.
Example:
; Int Example
+
+
+Blitz3D Docs
+
+
+
+
Int( value )
+
Parameters
+
+
+
+value = a number, or a string which represents a number
+
+
+
+
Description
+
+
+
+Converts the value to the nearest integer.
+
+This is the same as Blitz's automatic type conversion.
+So the two commands...
+
+n = value
+n = Int( value )
+
+... do exactly the same thing when n is an integer variable.
+
+If Int is applied to a string it converts as much as possible:
+
+Int( "10" ) ........ result is 10
+Int( "3.7" ) ....... result is 3, stops at "." which can't be part of an integer
+Int( "junk3" ) .... result is 0, stops at "j"
+
+Int converts floating point numbers by rounding to the nearest integer.
+NOTE: This is not the traditional meaning of Int in Basic.
+
+What about numbers exactly halfway between integers?
+The rounding is to the nearest even integer:
+
+Int( 2.5 ) ... produces 2
+Int( 3.5 ) ... produces 4
+
+See also Floor and Ceil for other types of rounding.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoinNetGame.htm b/_release/help/commands/2d_commands/JoinNetGame.htm
index a260dfd..d54aa21 100644
--- a/_release/help/commands/2d_commands/JoinNetGame.htm
+++ b/_release/help/commands/2d_commands/JoinNetGame.htm
@@ -1,21 +1,56 @@
-Command: JoinNetGame JoinNetGame (gamename$,serverIP$) Definition:
Joins a network game in progress.
Parameter Description:
gamename$ = valid string containing game name to join
-serverIP$ = IP address of computer hosting game
Command Description:
Use this command to join a network game, bypassing the dialog box normally endured with the StartNetGame command.
-This returns 0 if the command failed, or 1 if the game was joined successfully.
Example:
; JoinNetGame example
-; Note; run the HostNetGame example code on the other computer
-; you wish to join with
+
+
+Blitz3D Docs
+
+
+
+
JoinNetGame (gamename$,serverIP$)
+
Parameters
+
+
+
+gamename$ = valid string containing game name to join
+serverIP$ = IP address of computer hosting game
+
+
+
+
Description
+
+
+
+Use this command to join a network game, bypassing the dialog box normally endured with the StartNetGame command.
+This returns 0 if the command failed, or 1 if the game was joined successfully.
+
+; JoinNetGame example
+; Note; run the HostNetGame example code on the other computer
+; you wish to join with
+
+gamename$="ShaneGame"
+; Change this to match the other computer's IP!
+serverIP$="0.0.0.0"
+
+; Make the join attempt
+joinResults=JoinNetGame(gamename$,serverIP$)
+
+Select joinResults
+Case 1
+Print "Joined the game successfully!"
+Default
+Print "Joining the game was unsuccessful."
+End Select
+WaitKey()
+
+
+
+
-gamename$="ShaneGame"
-; Change this to match the other computer's IP!
-serverIP$="0.0.0.0"
+Index
-; Make the join attempt
-joinResults=JoinNetGame(gamename$,serverIP$)
-
-Select joinResults
- Case 1
- Print "Joined the game successfully!"
- Default
- Print "Joining the game was unsuccessful."
-End Select
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyDown.htm b/_release/help/commands/2d_commands/JoyDown.htm
index 830383a..1070276 100644
--- a/_release/help/commands/2d_commands/JoyDown.htm
+++ b/_release/help/commands/2d_commands/JoyDown.htm
@@ -1,13 +1,47 @@
-Command: JoyDown JoyDown (button,[port]) Definition:
Returns TRUE if the specified joystick button is being held down.
Parameter Description:
button = number of joystick button to check
-port = number of joystick port to check (optional)
Command Description:
This command (and its counterparts KeyDown and MouseDown) is used to detect if a joystick button is being held down. You must check for each joystick button independantly with its corresponding number (unlike KeyDown which returns WHICH key is being held down). Also see JoyHit.
Example:
; JoyDown Example
+
+
+Blitz3D Docs
+
+
+
+
JoyDown (button,[port])
+
Parameters
+
+
+
+button = number of joystick button to check
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command (and its counterparts KeyDown and MouseDown) is used to detect if a joystick button is being held down. You must check for each joystick button independantly with its corresponding number (unlike KeyDown which returns WHICH key is being held down). Also see JoyHit.
+
+; JoyDown Example
+
+; Until user presses ESC, show the mouse button pressed
+While Not KeyHit(1)
+button$="No"
+For t = 1 To 5
+If JoyDown(t) Then button$=Str(t)
+Print button$ + " joystick button pressed!"
+Next
+Wend
+
+
+
+
-; Until user presses ESC, show the mouse button pressed
-While Not KeyHit(1)
-button$="No"
-For t = 1 To 5
-If JoyDown(t) Then button$=Str(t)
-Print button$ + " joystick button pressed!"
-Next
-Wend
-
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyHit.htm b/_release/help/commands/2d_commands/JoyHit.htm
index 7952e2c..6422105 100644
--- a/_release/help/commands/2d_commands/JoyHit.htm
+++ b/_release/help/commands/2d_commands/JoyHit.htm
@@ -1,15 +1,49 @@
-Command: JoyHit JoyHit (button,[port]) Definition:
Returns the number of times a specified joystick button has been hit.
Parameter Description:
button = number of joystick button to check
-port = number of joystick port to check (optional)
Command Description:
This command returns the number of times a specified joystick button has been hit since the last time you called the JoyHit() command. Also see KeyHit and MouseHit.
Example:
; JoyHit Example
+
+
+Blitz3D Docs
+
+
+
+
JoyHit (button,[port])
+
Parameters
+
+
+
+button = number of joystick button to check
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the number of times a specified joystick button has been hit since the last time you called the JoyHit() command. Also see KeyHit and MouseHit.
+
+; JoyHit Example
+
+; Set up the timer
+current=MilliSecs()
+Print "Press FireButton 1 a bunch of times for five seconds..."
+
+; Wait 5 seconds
+While MilliSecs() < current+5000
+Wend
+
+; Print the results
+Print "Pressed button " + JoyHit(1) + " times."
+
+
+
+
-; Set up the timer
-current=MilliSecs()
-Print "Press FireButton 1 a bunch of times for five seconds..."
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyType.htm b/_release/help/commands/2d_commands/JoyType.htm
index fbcc1f2..146bf46 100644
--- a/_release/help/commands/2d_commands/JoyType.htm
+++ b/_release/help/commands/2d_commands/JoyType.htm
@@ -1,16 +1,51 @@
-Command: JoyType JoyType ([port]) Definition:
Returns the type of joystick attached to the computer.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the type of joystick that is currently connected to the computer. It returns 0 if there is none, 1 for digital, and 2 for analog.
Example:
; JoyType() example
+
+
+Blitz3D Docs
+
+
+
+
JoyType ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the type of joystick that is currently connected to the computer. It returns 0 if there is none, 1 for digital, and 2 for analog.
+
+; JoyType() example
+
+; Check to see what stick is present - print the proper message
+Select JoyType()
+Case 0
+Print "Sorry, no joystick attached to system!"
+Case 1
+Print "Digital joystick is attached to system!"
+Case 2
+Print "Analog joystick is attched to system!"
+End Select
+
+; Wait for user to hit ESC
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Check to see what stick is present - print the proper message
-Select JoyType()
-Case 0
-Print "Sorry, no joystick attached to system!"
-Case 1
-Print "Digital joystick is attached to system!"
-Case 2
-Print "Analog joystick is attched to system!"
-End Select
+Index
-; Wait for user to hit ESC
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyX.htm b/_release/help/commands/2d_commands/JoyX.htm
index a8d50f5..d3ab015 100644
--- a/_release/help/commands/2d_commands/JoyX.htm
+++ b/_release/help/commands/2d_commands/JoyX.htm
@@ -1,7 +1,42 @@
-Command: JoyX JoyX ([port]) Definition:
Returns the X-axis coordinate of the joystick.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the value of the x-axis of the joystick. The range is -1 to 1 (full left to full right). The value returned is a floating point number. See the example.
Example:
; JoyX()/JoyY() example
+
+
+Blitz3D Docs
+
+
+
+
JoyX ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the value of the x-axis of the joystick. The range is -1 to 1 (full left to full right). The value returned is a floating point number. See the example.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyXDir.htm b/_release/help/commands/2d_commands/JoyXDir.htm
index c99871e..2e3363a 100644
--- a/_release/help/commands/2d_commands/JoyXDir.htm
+++ b/_release/help/commands/2d_commands/JoyXDir.htm
@@ -1,9 +1,44 @@
-Command: JoyXDir JoyXDir ([port]) Definition:
Returns the X-axis direction of the joystick.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the direction of the x-axis of the joystick being pressed. The value is -1 (left) or 1 (right). The value returned is an integer number. See the example. Perfect for digital joysticks.
+
+
+Blitz3D Docs
+
+
+
+
JoyXDir ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the direction of the x-axis of the joystick being pressed. The value is -1 (left) or 1 (right). The value returned is an integer number. See the example. Perfect for digital joysticks.
+
+As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+
+; JoyXDir() example
+
+While Not KeyHit(1)
+Cls
+Text 0,0,"Joy X Direction: " + JoyXDir()
+Wend
+
+
+
+
-As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyY.htm b/_release/help/commands/2d_commands/JoyY.htm
index 7aca12b..7b27bdc 100644
--- a/_release/help/commands/2d_commands/JoyY.htm
+++ b/_release/help/commands/2d_commands/JoyY.htm
@@ -1,7 +1,42 @@
-Command: JoyY JoyY ([port]) Definition:
Returns the Y-axis coordinate of the joystick.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the value of the x-axis of the joystick. The range is -1 to 1 (full up to full down). The value returned is a floating point number. See the example.
Example:
; JoyX()/JoyY() example
+
+
+Blitz3D Docs
+
+
+
+
JoyY ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the value of the x-axis of the joystick. The range is -1 to 1 (full up to full down). The value returned is a floating point number. See the example.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyYDir.htm b/_release/help/commands/2d_commands/JoyYDir.htm
index 7e12870..d477624 100644
--- a/_release/help/commands/2d_commands/JoyYDir.htm
+++ b/_release/help/commands/2d_commands/JoyYDir.htm
@@ -1,9 +1,44 @@
-Command: JoyYDir JoyYDir ([port]) Definition:
Returns the Y-axis direction of the joystick.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the direction of the Y-axis of the joystick being pressed. The value is -1 (up) or 1 (down). The value returned is an integer number. See the example. Perfect for digital joysticks.
+
+
+Blitz3D Docs
+
+
+
+
JoyYDir ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the direction of the Y-axis of the joystick being pressed. The value is -1 (up) or 1 (down). The value returned is an integer number. See the example. Perfect for digital joysticks.
+
+As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+
+; JoyYDir() example
+
+While Not KeyHit(1)
+Cls
+Text 0,0,"Joy Y Direction: " + JoyYDir()
+Wend
+
+
+
+
-As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyZ.htm b/_release/help/commands/2d_commands/JoyZ.htm
index 38a57ef..8e230f0 100644
--- a/_release/help/commands/2d_commands/JoyZ.htm
+++ b/_release/help/commands/2d_commands/JoyZ.htm
@@ -1,9 +1,43 @@
-Command: JoyZ JoyZ ([port]) Definition:
Returns the Z-axis coordinate of the joystick.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the value of the x-axis of the joystick. The range is -1 to 1 (Max to none). The value returned is a floating point number. See the example.
+
+
+Blitz3D Docs
+
+
+
+
JoyZ ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the value of the x-axis of the joystick. The range is -1 to 1 (Max to none). The value returned is a floating point number. See the example.
+As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+
+; JoyZ() example
+
+While Not KeyHit(1)
+Cls
+Text 0,0,"Joy Z Value: " + JoyZ()
+Wend
+
+
+
+
-As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/JoyZDir.htm b/_release/help/commands/2d_commands/JoyZDir.htm
index c0cc301..f4c328c 100644
--- a/_release/help/commands/2d_commands/JoyZDir.htm
+++ b/_release/help/commands/2d_commands/JoyZDir.htm
@@ -1,9 +1,44 @@
-Command: JoyZDir JoyZDir ([port]) Definition:
Returns the Z-axis direction of the joystick.
Parameter Description:
port = number of joystick port to check (optional)
Command Description:
This command returns the direction of the Z-axis of the joystick being pressed. The value is -1 (up) or 1 (down). The value returned is an integer number. See the example. Perfect for digital joysticks.
+
+
+Blitz3D Docs
+
+
+
+
JoyZDir ([port])
+
Parameters
+
+
+
+port = number of joystick port to check (optional)
+
+
+
+
Description
+
+
+
+This command returns the direction of the Z-axis of the joystick being pressed. The value is -1 (up) or 1 (down). The value returned is an integer number. See the example. Perfect for digital joysticks.
+
+As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+
+; JoyZDir() example
+
+While Not KeyHit(1)
+Cls
+Text 0,0,"Joy Z Direction: " + JoyZDir()
+Wend
+
+
+
+
-As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/KeyDown.htm b/_release/help/commands/2d_commands/KeyDown.htm
index cd177fd..8fd8284 100644
--- a/_release/help/commands/2d_commands/KeyDown.htm
+++ b/_release/help/commands/2d_commands/KeyDown.htm
@@ -1,12 +1,48 @@
-Command: KeyDown KeyDown (scancode) Definition:
Returns TRUE if the specified key on keyboard is being held down.
Parameter Description:
scancode = corresponding key scancode
Command Description:
This command (similar to its counterparts MouseDown and JoyDown) is used to detect if a key is being held down. This command returns a 0 if the key is not held down, a 1 if the key is held down. See ScanCodes.
Example:
; KeyDown() example
+
+
+Blitz3D Docs
+
+
+
+
KeyDown (scancode)
+
Parameters
+
+
+
+scancode = corresponding key scancode
+
+
+
+
Description
+
+
+
+This command (similar to its counterparts MouseDown and JoyDown) is used to detect if a key is being held down. This command returns a 0 if the key is not held down, a 1 if the key is held down.
+
+See Also: ScanCodes
+
+; KeyDown() example
+
+Print "Hold down ENTER key!"
+Delay 3000
+While Not KeyHit(1)
+If KeyDown(28) Then
+Print "Enter is being pressed!"
+Else
+Print
+End If
+Wend
+
+
+
-Print "Hold down ENTER key!"
-Delay 3000
-While Not KeyHit(1)
-If KeyDown(28) Then
-Print "Enter is being pressed!"
-Else
-Print
-End If
-Wend
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/KeyHit.htm b/_release/help/commands/2d_commands/KeyHit.htm
index 23f8301..c9b30aa 100644
--- a/_release/help/commands/2d_commands/KeyHit.htm
+++ b/_release/help/commands/2d_commands/KeyHit.htm
@@ -1,14 +1,48 @@
-Command: KeyHit KeyHit (scancode) Definition:
Returns the number of times a specified key has been hit.
Parameter Description:
scancode = the scancode for the key to test
Command Description:
This command returns the number of times a specified key has been hit since the last time you called the KeyHit() command. Check the ScanCodes for a complete listing of scancodes.
Example:
; KeyHit Example
+
+
+Blitz3D Docs
+
+
+
+
KeyHit (scancode)
+
Parameters
+
+
+
+scancode = the scancode for the key to test
+
+
+
+
Description
+
+
+
+This command returns the number of times a specified key has been hit since the last time you called the KeyHit() command. Check the ScanCodes for a complete listing of scancodes.
+
+; KeyHit Example
+
+; Set up the timer
+current=MilliSecs()
+Print "Press ESC a bunch of times for five seconds..."
+
+; Wait 5 seconds
+While MilliSecs() < current+5000
+Wend
+
+; Print the results
+Print "Pressed ESC " + KeyHit(1) + " times."
+
+
+
+
-; Set up the timer
-current=MilliSecs()
-Print "Press ESC a bunch of times for five seconds..."
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LSet.htm b/_release/help/commands/2d_commands/LSet.htm
index ab0b13f..fcc031d 100644
--- a/_release/help/commands/2d_commands/LSet.htm
+++ b/_release/help/commands/2d_commands/LSet.htm
@@ -1,4 +1,39 @@
-Command: LSet$ LSet$ (string$, length) Definition:
Pads a string with spaces to a specified value, left aligning the string.
Parameter Description:
string$ = any valid string or string variable
-length = how long you want the new string to be (including padding)
Command Description:
If you have a string that is say, 10 letters long, but you want to make it a full 25 letters, padding the rest of the string with spaces, this command will do so, leaving the original string value left justified.
Example:
name$="Shane R. Monroe"
-Print "New Padded Name: '" + LSet$(name$,40) + "'"
+string$ = any valid string or string variable
+length = how long you want the new string to be (including padding)
+
+
+
+
Description
+
+
+
+If you have a string that is say, 10 letters long, but you want to make it a full 25 letters, padding the rest of the string with spaces, this command will do so, leaving the original string value left justified.
+
+name$="Shane R. Monroe"
+Print "New Padded Name: '" + LSet$(name$,40) + "'"
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Last.htm b/_release/help/commands/2d_commands/Last.htm
index d8c9b61..8657336 100644
--- a/_release/help/commands/2d_commands/Last.htm
+++ b/_release/help/commands/2d_commands/Last.htm
@@ -1,43 +1,89 @@
-Command: Last Last type_variable Definition:
Move the Last object pointer to the Last object in the collection.
Parameter Description:
type_variable = the actual Type name, not the custom Type name
Command Description:
If you haven't read up on the TYPE
- command, you might want to do so before continuing.
-
Use this to assign a custom Type object to the last object in the collection.
- See the example.
Example:
; Define a crafts Type
-
Type crafts
- Field x
- Field y
- Field dead
- Field graphic
- End Type
-
; Create 100 crafts, with the unique name of alien
- For t = 1 To 100
- alien.crafts = New crafts
- alien\x = Rnd(0,640)
- alien\y = Rnd(0,480)
- alien\dead = 0
- alien\graphic = 1
- Next
-
; Move to the first object
- alien.crafts = First crafts
+type_variable = the actual Type name, not the custom Type name
+
+
+
+
Description
+
+
+
+If you haven't read up on the TYPE command, you might want to do so before continuing.
+
+Use this to assign a custom Type object to the last object in the collection. See the example.
+
+
+See also: Type, New, Before, After, First, Each, Insert, Delete.
+
+; Define a crafts Type
+
+Type crafts
+Field x
+Field y
+Field dead
+Field graphic
+End Type
+
+; Create 100 crafts, with the unique name of alien
+For t = 1 To 100
+alien.crafts = New crafts
+alien\x = Rnd(0,640)
+alien\y = Rnd(0,480)
+alien\dead = 0
+alien\graphic = 1
+Next
+
+; Move to the first object
+alien.crafts = First crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the next alien object
+alien = After alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the last alien object
+alien.crafts = Last crafts
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+; move to the second to the last alien object
+alien = Before alien
+
+Print alien\x
+Print alien\y
+Print alien\dead
+Print alien\graphic
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Left.htm b/_release/help/commands/2d_commands/Left.htm
index fbab031..a5b522d 100644
--- a/_release/help/commands/2d_commands/Left.htm
+++ b/_release/help/commands/2d_commands/Left.htm
@@ -1,4 +1,39 @@
-Command: Left$ Left$ (string$, length) Definition:
Return a certain number of the leftmost characters of a string.
Parameter Description:
string$ = any valid string variable
-length = a valid integer value up to the length of the string.
Command Description:
Use this command to get a certain number of the leftmost letters of a string. You will use this to truncate strings to make them fit somewhere, or to control the number of characters input.
Example:
name$="Shane Monroe"
-Print "The left 3 letters of your name are: " + Left$(name$,3)
+string$ = any valid string variable
+length = a valid integer value up to the length of the string.
+
+
+
+
Description
+
+
+
+Use this command to get a certain number of the leftmost letters of a string. You will use this to truncate strings to make them fit somewhere, or to control the number of characters input.
+
+name$="Shane Monroe"
+Print "The left 3 letters of your name are: " + Left$(name$,3)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Len.htm b/_release/help/commands/2d_commands/Len.htm
index 9fc47df..2a49f60 100644
--- a/_release/help/commands/2d_commands/Len.htm
+++ b/_release/help/commands/2d_commands/Len.htm
@@ -1,3 +1,38 @@
-Command: Len Len (string$) Definition:
Returns the number of characters in a string.
Parameter Description:
string$ = any valid string variable
Command Description:
This will let you determine the length (number of letters, spaces, characters, numbers, etc) inside a string. You can use this to ensure the player enters the right number of letters (like 3 letters for a high score table). Quite useful for 'string parsing' with other commands.
Example:
name$="Shane Monroe"
-Print "There are " + Len(name$) + " characters in your name!"
+This will let you determine the length (number of letters, spaces, characters, numbers, etc) inside a string. You can use this to ensure the player enters the right number of letters (like 3 letters for a high score table). Quite useful for 'string parsing' with other commands.
+
+name$="Shane Monroe"
+Print "There are " + Len(name$) + " characters in your name!"
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Line.htm b/_release/help/commands/2d_commands/Line.htm
index 1204855..11b5579 100644
--- a/_release/help/commands/2d_commands/Line.htm
+++ b/_release/help/commands/2d_commands/Line.htm
@@ -1,14 +1,49 @@
-Command: Line Line x,y,x1,y1 Definition:
Draws a line in the current drawing color from x,y to x1,y1.
Parameter Description:
x=starting x location of the line
-y=starting y location of the line
-x1=ending x location of the line
-y1=ending y location of the line
Command Description:
This command draws a line, in the current drawing color, from one point on the screen to another (from the x,y to x1,y1 location). See example.
Example:
; Line example
-Graphics 800,600,16
+
+
+Blitz3D Docs
+
+
+
+
Line x,y,x1,y1
+
Parameters
+
+
+
+x=starting x location of the line
+y=starting y location of the line
+x1=ending x location of the line
+y1=ending y location of the line
+
+
+
+
Description
+
+
+
+This command draws a line, in the current drawing color, from one point on the screen to another (from the x,y to x1,y1 location). See example.
+
+; Line example
+Graphics 800,600,16
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+; Set a random color
+Color Rnd(255),Rnd(255),Rnd(255)
+; Draw a random line
+Line Rnd(800),Rnd(600),Rnd(800),Rnd(600)
+Wend
+
+
+
+
-; Wait for ESC to hit
-While Not KeyHit(1)
-; Set a random color
-Color Rnd(255),Rnd(255),Rnd(255)
-; Draw a random line
-Line Rnd(800),Rnd(600),Rnd(800),Rnd(600)
-Wend
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LoadAnimImage.htm b/_release/help/commands/2d_commands/LoadAnimImage.htm
index b1406a3..3ccf199 100644
--- a/_release/help/commands/2d_commands/LoadAnimImage.htm
+++ b/_release/help/commands/2d_commands/LoadAnimImage.htm
@@ -1,50 +1,86 @@
-Command: LoadAnimImage LoadAnimImage (filename,width,height,first,count) Definition:
Loads an 'image strip' for use as an 'animated image' to be drawn later and return a handle.
Parameter Description:
filename = string designating full path and filename to image.
-width=width in pixels of each frame in the image.
-height=height in pixels of each frame in the image.
-first=the frame to start with (usually 0)
-count=how many frames you are using of the imagestrip
Command Description:
While similar to LoadImage, the LoadAnimImage loads a single image that is made up of 'frames' of seperate images (presumably to be used as frames of a graphic animation).
+
+
+Blitz3D Docs
+
+
+
+
LoadAnimImage (filename,width,height,first,count)
+
Parameters
+
+
+
+filename = string designating full path and filename to image.
+width=width in pixels of each frame in the image.
+height=height in pixels of each frame in the image.
+first=the frame to start with (usually 0)
+count=how many frames you are using of the imagestrip
+
+
+
+
Description
+
+
+
+While similar to LoadImage, the LoadAnimImage loads a single image that is made up of 'frames' of seperate images (presumably to be used as frames of a graphic animation).
+
+Like the LoadImage command, this command returns a file handle - a unique number to denote the graphic. Use a variable (usually GLOBAL) to contain this number, as you will need it to actually DRAW the image with the DrawImage command. See LoadImage command for more details.
+
+The imagestrip itself consists of 2 or more frames, arranged in a single graphic image. There is no spaces between the frames, and each frame must be the same width and height. When loaded, the frames will be indexed in a left-to-right, top-to-bottom fashion, starting in the top left corner. For examples, look at the file kaboom.bmp or sparks.bmp included in the C:Program FilesBlitzBasicsamplesgraphics folder of your computer. There are some free utilities floating around to help you do this.
+
+When drawing the image to the screen with the DrawImage command, you specify which frame to draw with the frame parameter.
+
+To actually make your image animate, you'll need to cycle through the frames (like a flip book, cartoon, or any other video) quickly to give the illusion of motion. Our example will show you how to use one of the sample imagestrips and make it animate. While it may seem confusing, we are going to do some timer work as well as a little weird math.
+
+Please look over the example (if your like me, over and over :). Note: You may need to change the location of the file to suit your system.
-Like the LoadImage command, this command returns a file handle - a unique number to denote the graphic. Use a variable (usually GLOBAL) to contain this number, as you will need it to actually DRAW the image with the DrawImage command. See LoadImage command for more details.
-The imagestrip itself consists of 2 or more frames, horizontally aligned in a single graphic image. There is no spaces between the frames, and each frame must be the same width and height. For examples, look at the file kaboom.bmp or sparks.bmp included in the C:\Program Files\BlitzBasic\samples\graphics folder of your computer. There are some free utilities floating around to help you do this.
+See also: LoadImage.
+
+; LoadAnimImage/MaskImage Example
+; With animation timers
+
+; Even though we don't have any functions, let's do variables global
+; One variable will hold the handle for the graphic, one will hold the
+; current frame we are displaying, and one will hold the milliseconds
+; timer so we can adjust the animation speed.
+Global gfxSparks, frmSparks, tmrSparks
+
+; Standard graphic declaration and double buffering setup
+Graphics 640,480,16
+SetBuffer BackBuffer()
+
+; Load the imagestrip up and denote the frames 32x32 - for a total of 3 frames
+gfxSparks=LoadAnimImage("c:Program FilesBlitzBasicsamplesGraphicsspark.bmp",32,32,0,3)
+
+; We mask the image's color pink to be the 'transparent' color - look at the
+; image in your favorite editor to see more why we use masking.
+MaskImage gfxSparks,255,0,255
+
+; Loop until ESC
+While Not KeyHit(1)
+Cls ; Standard clear screen
+
+; The next statment checks to see if 100 milliseconds has passes since we
+; last changed frames. Change the 100 to higher and lower values to
+; make the animation faster or slower.
+If MilliSecs() > tmrSparks + 100 Then
+tmrSparks=MilliSecs() ; 'reset' the timer
+frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are out
+End If
+DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image
+Flip ; show the buffer
+Wend
+
+
+
-When drawing the image to the screen with the DrawImage command, you specify which frame to draw with the frame parameter.
+Index
-To actually make your image animate, you'll need to cycle through the frames (like a flip book, cartoon, or any other video) quickly to give the illusion of motion. Our example will show you how to use one of the sample imagestrips and make it animate. While it may seem confusing, we are going to do some timer work as well as a little weird math.
-
-Please look over the example (if your like me, over and over :). Note: You may need to change the location of the file to suit your system.
Example:
; LoadAnimImage/MaskImage Example
-; With animation timers
-
-; Even though we don't have any functions, let's do variables global
-; One variable will hold the handle for the graphic, one will hold the
-; current frame we are displaying, and one will hold the milliseconds
-; timer so we can adjust the animation speed.
-Global gfxSparks, frmSparks, tmrSparks
-
-; Standard graphic declaration and double buffering setup
-Graphics 640,480,16
-SetBuffer BackBuffer()
-
-; Load the imagestrip up and denote the frames 32x32 - for a total of 3 frames
-gfxSparks=LoadAnimImage("c:\Program Files\BlitzBasic\samples\Graphics\spark.bmp",32,32,0,3)
-
-; We mask the image's color pink to be the 'transparent' color - look at the
-; image in your favorite editor to see more why we use masking.
-MaskImage gfxSparks,255,0,255
-
-; Loop until ESC
-While Not KeyHit(1)
-Cls ; Standard clear screen
-
-; The next statment checks to see if 100 milliseconds has passes since we
-; last changed frames. Change the 100 to higher and lower values to
-; make the animation faster or slower.
-If MilliSecs() > tmrSparks + 100 Then
-tmrSparks=MilliSecs() ; 'reset' the timer
-frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are out
-End If
-DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image
-Flip ; show the buffer
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LoadBuffer.htm b/_release/help/commands/2d_commands/LoadBuffer.htm
index fd9f59d..18c339b 100644
--- a/_release/help/commands/2d_commands/LoadBuffer.htm
+++ b/_release/help/commands/2d_commands/LoadBuffer.htm
@@ -1,16 +1,50 @@
-Command: LoadBuffer LoadBuffer (buffer, filename$) Definition:
Loads an image directly into a buffer in Blitz.
Parameter Description:
buffer = system or image buffer
-filename$ = string containing full path and filename of image
-
Command Description:
There are a hundred and one uses for this command, but probably most often used would be to display a title screen or some other 'one time viewing only' image to the front buffer (as in our example).
+
+
+Blitz3D Docs
+
+
+
+
LoadBuffer (buffer, filename$)
+
Parameters
+
+
+
+buffer = system or image buffer
+filename$ = string containing full path and filename of image
+
+
+
+
Description
+
+
+
+There are a hundred and one uses for this command, but probably most often used would be to display a title screen or some other 'one time viewing only' image to the front buffer (as in our example).
+
+You can also load to an image buffer or back buffer. The image is scaled to match the buffer size. This command returns 1 if the command was successful, 0 if there was an error.
+
+; LoadBuffer example
+
+; Set graphics mode
+Graphics 800,600,16
+
+; Load an image directly to the front buffer (your location may be different)
+LoadBuffer (FrontBuffer(),"C:Program FilesBlitz Basicsampleslitzanoidgfx itle.bmp")
+
+; wait for ESC so user gets to see the screen
+While Not KeyHit(1)
+Wend
+
+
+
+
-You can also load to an image buffer or back buffer. The image is scaled to match the buffer size. This command returns 1 if the command was successful, 0 if there was an error.
-; Set graphics mode
-Graphics 800,600,16
-
-; Load an image directly to the front buffer (your location may be different)
-LoadBuffer (FrontBuffer(),"C:\Program Files\Blitz Basic\samples\blitzanoid\gfx\title.bmp")
-
-; wait for ESC so user gets to see the screen
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LoadFont.htm b/_release/help/commands/2d_commands/LoadFont.htm
index e60d301..52fe652 100644
--- a/_release/help/commands/2d_commands/LoadFont.htm
+++ b/_release/help/commands/2d_commands/LoadFont.htm
@@ -1,48 +1,80 @@
-Command: LoadFont LoadFont (fontname$,height,bold,italic,underlined) Definition:
Loads a TrueType font into memory.
Parameter Description:
fontname = string containing font name
-height = font height desired
-bold = set to TRUE to load font as BOLD
-italic = set to TRUE to load font as ITALIC
-underlined set to TRUE to load font as UNDERLINED
-
Command Description:
This loads a TrueType font into memory for future use with printing commands such as Text. You will need to make the font active by using SetFont before writing any text with the new font.
+
+
+Blitz3D Docs
+
+
+
+
+fontname$ - name of font to be loaded, e.g. "arial"
+height - height of font in points (default is 12)
+bold - True to load bold version of font, False not to (default is False)
+italic - True to load italic version of font, False not to (default is False)
+underlined - True to load underlined version of font, False not to (default is False)
+
+
+
+
Description
+
+
+
+Loads a font and returns a font handle.
+
+You can then use the font handle with commands such as SetFont and FreeFont.
+
+Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
+
+; LoadFont/SetFont/FreeFont Example
+; ---------------------------------
+
+; Enable Graphics mode
+Graphics 800,600
+
+; Set global on font variables
+Global fntArial,fntArialB,fntArialI,fntArialU
+
+; Load fonts to a file handle variables
+fntArial=LoadFont("Arial",24)
+fntArialB=LoadFont("Arial",18,True)
+fntArialI=LoadFont("Arial",32,False,True)
+fntArialU=LoadFont("Arial",14,False,False,True)
+
+; Set the font and print text
+SetFont fntArial
+Text 400,0,"This is just plain Arial 24 point",True
+
+SetFont fntArialB
+Text 400,30,"This is bold Arial 18 point",True
+
+SetFont fntArialI
+Text 400,60,"This is italic Arial 32 point",True
+
+SetFont fntArialU
+Text 400,90,"This is underlined Arial 14 point",True
+
+; Standard 'wait for ESC' from user
+While Not KeyHit(1)
+Wend
+
+; Clear all the fonts from memory!
+FreeFont fntArial
+FreeFont fntArialB
+FreeFont fntArialI
+FreeFont fntArialU
+
+
+
-Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
+Index
-Be sure to free the memory used by the font went you are done using the FreeFont command.
-
-If the font fails to load for whatever reason, this command will return a zero.
Example:
; LoadFont/SetFont/FreeFont example
-
-; enable graphics mode
-Graphics 800,600,16
-
-; Set global on font variables
-Global fntArial,fntArialB,fntArialI,fntArialU
-
-;Load fonts to a file handle variables
-fntArial=LoadFont("Arial",24,False,False,False)
-fntArialB=LoadFont("Arial",18,True,False,False)
-fntArialI=LoadFont("Arial",32,False,True,False)
-fntArialU=LoadFont("Arial",14,False,False,True)
-
-; set the font and print text
-SetFont fntArial
-Text 400,0,"This is just plain Arial 24 point",True,False
-
-SetFont fntArialB
-Text 400,30,"This is bold Arial 18 point",True,False
-
-SetFont fntArialI
-Text 400,60,"This is italic Arial 32 point",True,False
-
-SetFont fntArialU
-Text 400,90,"This is underlined Arial 14 point",True,False
-
-; Standard 'wait for ESC' from user
-While Not KeyHit(1)
-Wend
-
-; Clear all the fonts from memory!
-FreeFont fntArial
-FreeFont fntArialB
-FreeFont fntArialI
-FreeFont fntArialU
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LoadImage.htm b/_release/help/commands/2d_commands/LoadImage.htm
index 9ccdee5..fcd721b 100644
--- a/_release/help/commands/2d_commands/LoadImage.htm
+++ b/_release/help/commands/2d_commands/LoadImage.htm
@@ -1,30 +1,69 @@
-Command: LoadImage LoadImage (Filename) Definition:
Loads an image into memory and assigns it a handle.
Parameter Description:
filename = string designating full path and filename to image.
Command Description:
This command loads an image from disk and assigns it a file handle. You will use the DrawImage command to display the graphic later. The demo version of Blitz Basic supports BMP files; the full retail version of Blitz Basic supports JPG and PNG format as well.
+
+
+Blitz3D Docs
+
+
+
+
LoadImage (Filename)
+
Parameters
+
+
+
+filename = string designating full path and filename to image.
+
+
+
+
Description
+
+
+
+This command loads an image from disk and assigns it a file handle. You will use the DrawImage command to display the graphic later. The demo version of Blitz Basic supports BMP files; the full retail version of Blitz Basic supports JPG and PNG format as well.
+
+Many multimedia loading commands for fonts, graphics, and sounds require the use of FILE HANDLES. You'll need to have a good understanding of file handles if you are going to successfully use Blitz Basic.
+
+A file handle is a variable (usually GLOBAL) that holds a unique identifier for a loaded item (font, image, sound, music, etc.). This unique number is used later for subsequent operations to designate the loaded item. This file handle allocates the memory to hold the item.
+
+You will find file handles used all over Blitz. See the example for some well-documented code.
+
+Note that when you change the graphics mode using the Graphics command, all images that were loaded will be lost, and all handles will become invalid. However, with BlitzPlus, the images will sometimes be retained. Expect more control over this in the next BlitzPlus update.
-Many multimedia loading commands for fonts, graphics, and sounds require the use of FILE HANDLES. You'll need to have a good understanding of file handles if you are going to successfully use Blitz Basic.
-A file handle is a variable (usually GLOBAL) that holds a unique identifier for a loaded item (font, image, sound, music, etc.). This unique number is used later for subsequent operations to designate the loaded item. This file handle allocates the memory to hold the item.
+See also: LoadAnimImage, CreateImage, FreeImage, SaveImage, DrawImage, Graphics.
+
+; LoadImage and DrawImage example
+
+; Declare a variable to hold the graphic file handle
+Global gfxPlayer
+
+; Set a graphics mode
+Graphics 640,480,16
+
+; Set drawing operations for double buffering
+SetBuffer BackBuffer()
+
+; Load the image and assign its file handle to the variable
+; - This assumes you have a graphic called player.bmp in the
+; same folder as this source code
+gfxPlayer=LoadImage("player.bmp")
+
+; Let's do a loop where the graphic is drawn wherever the
+; mouse is pointing. ESC will exit.
+While Not KeyHit(1)
+Cls ; clear the screen
+DrawImage gfxPlayer,MouseX(),MouseY() ; Draw the image!
+Flip ; flip the image into view and clear the back buffer
+Wend
+
+
+
-You will find file handles used all over Blitz. See the example for some well-documented code.
-; Declare a variable to hold the graphic file handle
-Global gfxPlayer
-
-; Set a graphics mode
-Graphics 640,480,16
-
-; Set drawing operations for double buffering
-SetBuffer BackBuffer()
-
-; Load the image and assign its file handle to the variable
-; - This assumes you have a graphic called player.bmp in the
-; same folder as this source code
-gfxPlayer=LoadImage("player.bmp")
-
-; Let's do a loop where the graphic is drawn wherever the
-; mouse is pointing. ESC will exit.
-While Not KeyHit(1)
-Cls ; clear the screen
-DrawImage gfxPlayer,MouseX(),MouseY() ; Draw the image!
-Flip ; flip the image into view and clear the back buffer
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LoadSound.htm b/_release/help/commands/2d_commands/LoadSound.htm
index cc66bb4..8899e07 100644
--- a/_release/help/commands/2d_commands/LoadSound.htm
+++ b/_release/help/commands/2d_commands/LoadSound.htm
@@ -1,13 +1,46 @@
-Command: LoadSound LoadSound (filename$) Definition:
Load a sound file into memory.
Parameter Description:
filename$ = valid string with path/filename to the sound file
Command Description:
This command loads a sound file (.WAV or .MP3) into memory. It returns a number if successful, or 0 if there was a problem loading the sound. You must assign value this returns to a variable (preferably a Global variable) for subsequent playback using (PlaySound}. Look at the example.
-
Example:
; Assign a global variable for the sound
-Global sndPlayerDie
+
+
+Blitz3D Docs
+
+
+
+
LoadSound (filename$)
+
Parameters
+
+
+
+filename$ - name of sound file. Formats supported: raw/wav/mp3/ogg
+
+
+
+
Description
+
+
+
+This command loads a sound file into memory. It returns a number if successful, or 0 if there was a problem loading the sound. You must assign the value this returns to a variable (preferably a Global variable) for subsequent playback using (PlaySound). Look at the example.
+
+; Assign a global variable for the sound
+Global sndPlayerDie
+
+; Load the sound file into memory
+
+sndPlayerDie=LoadSound("sounds/die.wav")
+
+; Play the sound
+
+PlaySound sndPlayerDie
+
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Local.htm b/_release/help/commands/2d_commands/Local.htm
index 427ae2c..56effb1 100644
--- a/_release/help/commands/2d_commands/Local.htm
+++ b/_release/help/commands/2d_commands/Local.htm
@@ -1,18 +1,53 @@
-Command: Local Local variable Definition:
Declares a variable as local.
Parameter Description:
variable = any valid variable name
-
Command Description:
This command is probably just here for compatibility with other BASIC languages. LOCAL will let you specify that the variable you are defining is available ONLY to the program or Function you are assigning it in. In order to get a variable to be accessible anywhere in your program, you need to make it GLOBAL. I say it is only here for compatibility because whenever you assign a variable that isn't Global, it is automatically assigned as a LOCAL variable. You can optionally assign a value to the variable at the time of declaration. See example.
Example:
; Local example
+
+
+Blitz3D Docs
+
+
+
+
Local variable
+
Parameters
+
+
+
+variable = any valid variable name
+
+
+
+
Description
+
+
+
+This command is probably just here for compatibility with other BASIC languages. LOCAL will let you specify that the variable you are defining is available ONLY to the program or Function you are assigning it in. In order to get a variable to be accessible anywhere in your program, you need to make it GLOBAL. I say it is only here for compatibility because whenever you assign a variable that isn't Global, it is automatically assigned as a LOCAL variable. You can optionally assign a value to the variable at the time of declaration. See example.
-; set lives to 5 for the main program loop
-Local lives=5
-; Call a function
-while not keyhit(1)
-showlives()
-Wend
+See also: Global, Const, Dim.
+
+; Local example
+
+; set lives to 5 for the main program loop
+Local lives=5
+
+; Call a function
+while not keyhit(1)
+showlives()
+Wend
+
+Function showlives()
+; For this function, lives will be 10!
+Local lives=10
+Print lives
+End Function
+
+
+
-Function showlives()
-; For this function, lives will be 10!
-Local lives=10
-Print lives
-End Function
-
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Locate.htm b/_release/help/commands/2d_commands/Locate.htm
index b434684..353b42c 100644
--- a/_release/help/commands/2d_commands/Locate.htm
+++ b/_release/help/commands/2d_commands/Locate.htm
@@ -1,12 +1,47 @@
-Command: Locate Locate x,y Definition:
Locates the text commands starting point on the screen.
Parameter Description:
x=x coordinate on the screen
-y=y coordinate on the screen
Command Description:
Sometimes you want to place the PRINT and Input$ commands at a specific location on the screen. This command locates the 'cursor' to the designated location.
Example:
; Locate example
+
+
+Blitz3D Docs
+
+
+
+
Locate x,y
+
Parameters
+
+
+
+x=x coordinate on the screen
+y=y coordinate on the screen
+
+
+
+
Description
+
+
+
+Sometimes you want to place the PRINT and Input$ commands at a specific location on the screen. This command locates the 'cursor' to the designated location.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LockBuffer.htm b/_release/help/commands/2d_commands/LockBuffer.htm
index e30ce11..6ba90e1 100644
--- a/_release/help/commands/2d_commands/LockBuffer.htm
+++ b/_release/help/commands/2d_commands/LockBuffer.htm
@@ -1,37 +1,73 @@
-Command: LockBuffer LockBuffer buffer Definition:
Locks a buffer for high speed pixel operations.
Parameter Description:
buffer = any valid screen/image buffer (optional)
Command Description:
After you use LockBuffer on a buffer, the only graphics commands you can use are the read/write pixel commands ReadPixel, WritePixel, ReadPixelFast, WritePixelFast, CopyPixelFast, and CopyPixel. You must UnlockBuffer before using other graphics commands.
-
-The buffer parameter isn't required. If omitted, the default buffer set with SetBuffer will be used.
-
+
+
+Blitz3D Docs
+
+
+
+
LockBuffer buffer
+
Parameters
+
+
+
+buffer = any valid screen/image buffer (optional)
+
+
+
+
Description
+
+
+
+After you use LockBuffer on a buffer, the only graphics commands you can use are the read/write pixel commands ReadPixel, WritePixel, ReadPixelFast, WritePixelFast, CopyPixelFast, and CopyPixel. You must UnlockBuffer before using other graphics commands or API calls, and you are advised to only keep the buffer locked for as long as it is needed.
+
+The buffer parameter isn't required. If omitted, the default buffer set with SetBuffer will be used.
+
See the other commands for more information.
-
+; High Speed Graphics Commands
+
+Graphics 640,480,16
+
+; Draw a bunch of stuff on the screen
+For t= 1 To 1000
+Color Rnd(255),Rnd(255),Rnd(255)
+Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
+Next
+
+Delay 3000
+
+; Copy the top half of the screen over the bottom half
+; using fast pixels and locked buffers
+For x = 1 To 640
+For y = 1 To 240
+LockBuffer FrontBuffer()
+WritePixelFast x,y+241,ReadPixelFast(x,y)
+UnlockBuffer FrontBuffer()
+Next
+Next
+
+Delay 3000
+
+; Draw the left half of the screen over the right half
+; using the slower direct pixel access
+For x = 1 To 320
+For y = 1 To 480
+WritePixel x+320,y,ReadPixel(x,y)
+Next
+Next
+
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-For x = 1 To 640
-For y = 1 To 240
-LockBuffer FrontBuffer()
-WritePixelFast x,y+241,ReadPixelFast(x,y)
-UnlockBuffer FrontBuffer()
-Next
-Next
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-WritePixel x+320,y,ReadPixel(x,y)
-Next
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Log.htm b/_release/help/commands/2d_commands/Log.htm
index 33a21b3..49a01c7 100644
--- a/_release/help/commands/2d_commands/Log.htm
+++ b/_release/help/commands/2d_commands/Log.htm
@@ -1,8 +1,73 @@
-Command: Log Log (number) Definition:
Returns the natural logarithm of the supplied argument.
Parameter Description:
number=float or integer
Command Description:
Log() is the logarithmic (or inverse exponential) function. Logarithms to the base e are called the Natural or Napierian logarithms. The Exp() and Log() functions uses the transcendental number e as a base (approx 2.718). Log() is the inverse of the Exponential Exp() function. Log(e) = 1
-See also: ExpLog10
Example:
; To find the value of Log(e^5)
-e# = Exp(1)
-x# = 5
-y# = e#^x#
-Print y ; i.e. e^5 = e*e*e*e*e: returns 148.413131
-Print Log(y) ; ie. Log(e^5) = Log(10000): returns 5.000000
+Natural logarithm of x. This is the inverse of Exp( ).
+
+y = Log( x ) means y satifies x = Exp( y ).
+
+The base of the natural logarithm is e = Exp(1) = 2.71828...
+
+See also Exp()
+
+; Log example
+
+; NaN means "Not a Number", the numerical result is invalid.
+
+; NOTE: All logarithm functions are related. For example, there is no
+; Log8 function in Blitz, but we can easily make one.
+
+HidePointer
+
+Print "Log8( -1 ) = " + Log8( -1 )
+Print "Log8( 0 ) = " + Log8( 0 )
+Print
+
+; ... and now some well behaved numbers...
+
+x# = 1.0 / 4096.0 ; small positive number
+
+For n = 1 To 15
+
+Print "Log8( " + LSet( x, 13 ) + " ) = " + Log8( x )
+x = 8 * x
+
+Next
+
+WaitKey() : End
+
+
+Function Log8# ( x# )
+
+Return Log( x ) / Log( 8 )
+
+End Function
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Log10.htm b/_release/help/commands/2d_commands/Log10.htm
index 9e01f52..636cae5 100644
--- a/_release/help/commands/2d_commands/Log10.htm
+++ b/_release/help/commands/2d_commands/Log10.htm
@@ -1,7 +1,61 @@
-Command: Log10 Log10 (number) Definition:
Returns the common logarithm of the supplied argument (base 10).
Parameter Description:
number=float or integer
Command Description:
Log10() is the logarithm (or inverse exponential) function to base 10. Logarithms to the base 10 are called the common logarithms. The Log10() functions uses 10 as a base. It follows the series 10^x. This function is useful for finding the power of a number in base 10.
-See also: ExpLog
Example:
; To find the value of Log10(10^5)
-x = 5
-y = 10^x
-Print y ; i.e. 10^5 = 10*10*10*10*10: returns 100000
-Print Log10(y) ; ie. Log10(10^5) = Log10(10000): returns 5.000000
+; Log10 example
+
+; NaN means "Not a Number", the numerical result is invalid.
+
+HidePointer
+
+; First, what happens with non-positive numbers...
+
+Print "Log10( -1 ) = " + Log10( -1 )
+Print "Log10( 0 ) = " + Log10( 0 )
+Print
+
+; ... and now some well behaved numbers...
+
+x# = 1.0 / 4096.0 ; small positive number
+
+For n = 1 To 15
+
+Print "Log10( " + LSet( x, 13 ) + " ) = " + Log10( x )
+x = 8 * x
+
+Next
+
+WaitKey() : End
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/LoopSound.htm b/_release/help/commands/2d_commands/LoopSound.htm
index 30fc223..015b333 100644
--- a/_release/help/commands/2d_commands/LoopSound.htm
+++ b/_release/help/commands/2d_commands/LoopSound.htm
@@ -1,17 +1,48 @@
-Command: LoopSound LoopSound sound_variable Definition:
Sets up a previously loaded sound to play in a constant loop once the sound is played.
Parameter Description:
sound_variable = variable previously assigned with a LoadSound command.
-
Command Description:
This command sets up play back a sound file (.WAV or .MP3) in an endless loop (like for background music). You must load a variable with a sound file using the LoadSound command. Use a Global variable to ensure your sound loop can be played from anywhere in your program.
+
+
+Blitz3D Docs
+
+
+
+
LoopSound sound_variable
+
Parameters
+
+
+
+sound_variable = variable previously assigned with a LoadSound command.
+
+
+
+
Description
+
+
+
+This command sets up play back a sound file (.WAV or .MP3) in an endless loop (like for background music). You must load a variable with a sound file using the LoadSound command. Use a Global variable to ensure your sound loop can be played from anywhere in your program. Note: This command doesn't actually PLAY the sound loop, just sets it up for looping. You still need to execute the PlaySound command to hear the sound.
+
+; Assign a global variable for the sound loop
+Global sndMusicLoop
+
+; Load the sound loop file into memory
+
+sndMusicLoop=LoadSound("sounds/loop1.wav")
+
+; Set the sound loop
+
+LoopSound sndMusicLoop
+
+PlaySound sndMusicLoop
-Note: This command doesn't actually PLAY the sound loop, just sets it up for looping. You still need to execute the PlaySound command to hear the sound.
Example:
; Assign a global variable for the sound loop
-Global sndMusicLoop
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Lower.htm b/_release/help/commands/2d_commands/Lower.htm
index 4b911e1..21c32f3 100644
--- a/_release/help/commands/2d_commands/Lower.htm
+++ b/_release/help/commands/2d_commands/Lower.htm
@@ -1,5 +1,39 @@
-Command: Lower$ Lower$ (string$) Definition:
Convert a string to all lower case.
Parameter Description:
string$ = any valid string variable
Command Description:
This will take a string and convert it all to lower case letters. Pretty straight forward.
Example:
name$="ShAnE MoNrOe"
-Print "The original name is: " + name$
-Print "In lower case it is: " + Lower$(name$)
-
+name$="ShAnE MoNrOe"
+Print "The original name is: " + name$
+Print "In lower case it is: " + Lower$(name$)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MaskImage.htm b/_release/help/commands/2d_commands/MaskImage.htm
index 3e6ead0..2d7e84f 100644
--- a/_release/help/commands/2d_commands/MaskImage.htm
+++ b/_release/help/commands/2d_commands/MaskImage.htm
@@ -1,39 +1,72 @@
-Command: MaskImage MaskImage handle,red,green,blue Definition:
Set the image's mask or transparent color.
Parameter Description:
handle=the variable you assigned the handle to when you loaded the image.
-red=the red color value (0-255)
-green=the green color value (0-255)
-blue=the blue color value (0-255)
Command Description:
Blitz Basic assumes that when you load an image (using LoadImage or LoadAnimImage) for drawing (using DrawImage command), you want the color black (RGB color 0,0,0) on your image to be transparent (or see through). There WILL come a time when you want some other color to be that masked color. This command will let you set that mask color using the color's RGB values (I use Paint Shop Pro to determing the Red, Green, and Blue values). The example is a bit bloated for other commands, but I'm pretty sure you'll understand.
Example:
; LoadAnimImage/MaskImage Example
-; With animation timers
+
+
+Blitz3D Docs
+
+
+
+
MaskImage handle,red,green,blue
+
Parameters
+
+
+
+handle=the variable you assigned the handle to when you loaded the image.
+red=the red color value (0-255)
+green=the green color value (0-255)
+blue=the blue color value (0-255)
+
+
+
+
Description
+
+
+
+Blitz Basic assumes that when you load an image (using LoadImage or LoadAnimImage) for drawing (using DrawImage command), you want the color black (RGB color 0,0,0) on your image to be transparent (or see through). There WILL come a time when you want some other color to be that masked color. This command will let you set that mask color using the color's RGB values (I use Paint Shop Pro to determing the Red, Green, and Blue values). The example is a bit bloated for other commands, but I'm pretty sure you'll understand.
+
+; LoadAnimImage/MaskImage Example
+; With animation timers
+
+; Even though we don't have any functions, let's do variables global
+; One variable will hold the handle for the graphic, one will hold the
+; current frame we are displaying, and one will hold the milliseconds
+; timer so we can adjust the animation speed.
+Global gfxSparks, frmSparks, tmrSparks
+
+; Standard graphic declaration and double buffering setup
+Graphics 640,480,16
+SetBuffer BackBuffer()
+
+; Load the imagestrip up and denote the frames 32x32 - for a total of 3 frames
+gfxSparks=LoadAnimImage("c:Program FilesBlitzBasicsamplesGraphicsspark.bmp",32,32,0,3)
+
+; We mask the image's color pink to be the 'transparent' color - look at the
+; image in your favorite editor to see more why we use masking.
+MaskImage gfxSparks,255,0,255
+
+; Loop until ESC
+While Not KeyHit(1)
+Cls ; Standard clear screen
+
+; The next statment checks to see if 100 milliseconds has passes since we
+; last changed frames. Change the 100 to higher and lower values to
+; make the animation faster or slower.
+If MilliSecs() > tmrSparks + 100 Then
+tmrSparks=MilliSecs() ; 'reset' the timer
+frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are out
+End If
+DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image
+Flip ; show the buffer
+Wend
+
+
+
-; Even though we don't have any functions, let's do variables global
-; One variable will hold the handle for the graphic, one will hold the
-; current frame we are displaying, and one will hold the milliseconds
-; timer so we can adjust the animation speed.
-Global gfxSparks, frmSparks, tmrSparks
+Index
-; Standard graphic declaration and double buffering setup
-Graphics 640,480,16
-SetBuffer BackBuffer()
-
-; Load the imagestrip up and denote the frames 32x32 - for a total of 3 frames
-gfxSparks=LoadAnimImage("c:\Program Files\BlitzBasic\samples\Graphics\spark.bmp",32,32,0,3)
-
-; We mask the image's color pink to be the 'transparent' color - look at the
-; image in your favorite editor to see more why we use masking.
-MaskImage gfxSparks,255,0,255
-
-; Loop until ESC
-While Not KeyHit(1)
-Cls ; Standard clear screen
-
-; The next statment checks to see if 100 milliseconds has passes since we
-; last changed frames. Change the 100 to higher and lower values to
-; make the animation faster or slower.
-If MilliSecs() > tmrSparks + 100 Then
-tmrSparks=MilliSecs() ; 'reset' the timer
-frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are out
-End If
-DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image
-Flip ; show the buffer
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Mid.htm b/_release/help/commands/2d_commands/Mid.htm
index 4889840..8e22027 100644
--- a/_release/help/commands/2d_commands/Mid.htm
+++ b/_release/help/commands/2d_commands/Mid.htm
@@ -1,10 +1,41 @@
-Command: Mid$ Mid$ (string$, offset, characters) Definition:
Retrieves a certain number of characters within a string, from a particular position.
Parameter Description:
string$ = any valid string
-offset = location within the string to start reading
-characters = how many characters to read frm the offset point
Command Description:
Use this command to grab a set of characters from within a string. You can choose WHERE to start in the string, and how many characters to pick. You'll probably use this to 'decode' or 'walk through' a string to get each character out of it for conversion or validation. See the Example.
Example:
name$="Shane Monroe"
-For T = 1 To Len(name$)
-Print Mid$(name$,t,1)
-Next
+
+
+Blitz3D Docs
+
+
+
+
Mid$ (string$, offset, characters)
+
Parameters
+
+
+
+string$ = any valid string
+offset = location within the string to start reading
+characters = how many characters to read frm the offset point
+
+
+
+
Description
+
+
+
+Use this command to grab a set of characters from within a string. You can choose WHERE to start in the string, and how many characters to pick. You'll probably use this to 'decode' or 'walk through' a string to get each character out of it for conversion or validation. See the Example.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Millisecs.htm b/_release/help/commands/2d_commands/Millisecs.htm
index 4937ccd..6945ac7 100644
--- a/_release/help/commands/2d_commands/Millisecs.htm
+++ b/_release/help/commands/2d_commands/Millisecs.htm
@@ -1,2 +1,43 @@
-Command: Millisecs() Millisecs() Definition:
Return the system's timer value in milliseconds.
Parameter Description:
None
Command Description:
This command will return to you the system timer value in milliseconds.
This is incredibly useful for precision timing of events. By reading this value into a variable, and checking it against the CURRENT time in milliseconds, you can perform 'waits' or check time lapses with a high degree of accuracy. A common use of this command is to seed the random number generator with the SeedRnd command.
Example:
; This prints STILL WAITING! for three seconds then ends. oldTime=MilliSecs() While MilliSecs() < oldTime + 3000 Print "Still waiting!" Wend
+This command will return to you the system timer value in milliseconds.
+
+This is incredibly useful for precision timing of events. By reading this value into a variable, and checking it against the CURRENT time in milliseconds, you can perform 'waits' or check time lapses with a high degree of accuracy. A common use of this command is to seed the random number generator with the SeedRnd command.
+
+; This prints STILL WAITING! for three seconds then ends.
+oldTime=MilliSecs()
+While MilliSecs() < oldTime + 3000
+Print "Still waiting!"
+Wend
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Mod.htm b/_release/help/commands/2d_commands/Mod.htm
index fb0cb19..42c2471 100644
--- a/_release/help/commands/2d_commands/Mod.htm
+++ b/_release/help/commands/2d_commands/Mod.htm
@@ -1,6 +1,39 @@
-Command: Mod Mod Definition:
Returns the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number.
Parameter Description:
None
Command Description:
Basically, this will divide your number as many times as possible by the divisor, then return you the remaining amount.
Example:
; MOD Example
+
+
+Blitz3D Docs
+
+
+
+
Mod
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+Basically, this will divide your number as many times as possible by the divisor, then return you the remaining amount.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseDown.htm b/_release/help/commands/2d_commands/MouseDown.htm
index 6102e9e..925c40e 100644
--- a/_release/help/commands/2d_commands/MouseDown.htm
+++ b/_release/help/commands/2d_commands/MouseDown.htm
@@ -1,13 +1,47 @@
-Command: MouseDown MouseDown (button) Definition:
Returns TRUE if the specified mouse button is being held down.
Parameter Description:
button = 1: Left Button, 2: Right Button, 3: Middle Button
Command Description:
This command (and its counterparts KeyDown and JoyDown) is used to detect if a mouse button is being held down. You must check for each mouse button independantly with its corresponding number (unlike KeyDown which returns WHICH key is being held down). Also see MouseHit.
Example:
; MouseDown Example
+
+
+Blitz3D Docs
+
+
+
+
MouseDown (button)
+
Parameters
+
+
+
+button = 1: Left Button, 2: Right Button, 3: Middle Button
+
+
+
+
Description
+
+
+
+This command (and its counterparts KeyDown and JoyDown) is used to detect if a mouse button is being held down. You must check for each mouse button independantly with its corresponding number (unlike KeyDown which returns WHICH key is being held down). Also see MouseHit.
+
+; MouseDown Example
+
+; Until user presses ESC, show the mouse button pressed
+While Not KeyHit(1)
+button$="No"
+If MouseDown(1) Then button$="Left"
+If MouseDown(2) Then button$="Right"
+If MouseDown(3) Then button$="Middle"
+
+Print button$ + " mouse button pressed!"
+Wend
+
+
+
+
-; Until user presses ESC, show the mouse button pressed
-While Not KeyHit(1)
-button$="No"
-If MouseDown(1) Then button$="Left"
-If MouseDown(2) Then button$="Right"
-If MouseDown(3) Then button$="Middle"
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseHit.htm b/_release/help/commands/2d_commands/MouseHit.htm
index 834963a..fd3b9c2 100644
--- a/_release/help/commands/2d_commands/MouseHit.htm
+++ b/_release/help/commands/2d_commands/MouseHit.htm
@@ -1,14 +1,48 @@
-Command: MouseHit MouseHit (button) Definition:
Returns the number of times a specified mouse button has been hit.
Parameter Description:
button = button code (1=Left, 2=Right, 3-Middle)
Command Description:
This command returns the number of times a specified mouse button has been hit since the last time you called the MouseHit() command. Also see KeyHit and JoyHit.
+This command returns the number of times a specified mouse button has been hit since the last time you called the MouseHit() command. Also see KeyHit and JoyHit.
+
+; MouseHit Example
+
+; Set up the timer
+current=MilliSecs()
+Print "Press left mouse button a bunch of times for five seconds..."
+
+; Wait 5 seconds
+While MilliSecs() < current+5000
+Wend
+
+; Print the results
+Print "Pressed left button " + MouseHit(1) + " times."
+
+
+
+
-; Set up the timer
-current=MilliSecs()
-Print "Press left mouse button a bunch of times for five seconds..."
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseX.htm b/_release/help/commands/2d_commands/MouseX.htm
index ce69eb3..b865375 100644
--- a/_release/help/commands/2d_commands/MouseX.htm
+++ b/_release/help/commands/2d_commands/MouseX.htm
@@ -1,36 +1,59 @@
-Command: MouseX() MouseX() Definition:
Returns the mouse's X screen coordinate.
Parameter Description:
None
Command Description:
This command returns the mouse's X location on the screen. Use this with the DrawImage command to make a custom mouse pointer, or to control something directly on the screen with the mouse. Use MouseY() to get the Y coordinate.
Example:
; LoadAnimImage/MaskImage MouseX()/MouseY() Example
-; With animation timers
+
+
+Blitz3D Docs
+
+
+
+
MouseX()
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+This command returns the X location of the mouse on the screen. This position is always from the range 0 to GraphicsWidth( ) - 1. You can use this command in combination with DrawImage to make a custom mouse pointer, or to control something on the screen directly with the mouse.
-; Even though we don't have any functions, let's do variables global
-; One variable will hold the handle for the graphic, one will hold the
-; current frame we are displaying, and one will hold the milliseconds
-; timer so we can adjust the animation speed.
-Global gfxSparks, frmSparks, tmrSparks
-; Standard graphic declaration and double buffering setup
-Graphics 640,480,16
-SetBuffer BackBuffer()
+See also: MouseY, MouseZ.
+
-; Load the imagestrip up and denote the frames 32x32 - for a total of 3 frames
-gfxSparks=LoadAnimImage("c:\Program Files\BlitzBasic\samples\Graphics\spark.bmp",32,32,0,3)
+Index
-; We mask the image's color pink to be the 'transparent' color - look at the
-; image in your favorite editor to see more why we use masking.
-MaskImage gfxSparks,255,0,255
-
-; Loop until ESC
-While Not KeyHit(1)
-Cls ; Standard clear screen
-
-; The next statment checks to see if 100 milliseconds has passes since we
-; last changed frames. Change the 100 to higher and lower values to
-; make the animation faster or slower.
-If MilliSecs() > tmrSparks + 100 Then
-tmrSparks=MilliSecs() ; 'reset' the timer
-frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are out
-End If
-DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image at MouseX and Y
-Flip ; show the buffer
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseXSpeed.htm b/_release/help/commands/2d_commands/MouseXSpeed.htm
index 9f1e33b..ef8c31c 100644
--- a/_release/help/commands/2d_commands/MouseXSpeed.htm
+++ b/_release/help/commands/2d_commands/MouseXSpeed.htm
@@ -1,31 +1,73 @@
-Command: MouseXSpeed() MouseXSpeed() Definition:
Returns the changes in the mouse location since the LAST call to the command
Parameter Description:
None.
Command Description:
Often you'd like to find the difference between where the mouse WAS to where it is NOW. You can use this command and MouseYSpeed() in pairs to find out the changes in the mouse location between calls.
+
+
+Blitz3D Docs
+
+
+
+
MouseXSpeed()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Often you'd like to find the difference between where the mouse WAS to where it is NOW. You can use this command and MouseXSpeed() in pairs to find out the changes in the mouse location between calls.
+
+You really have to use these commands TWICE to get anything out of them. Each call you make returns the difference in location since the LAST time you called it.
+
+In this example it's called every loop and therefore allows you to have infinite mouse movement without the screen size restrictions.
-You really have to use these commands TWICE to get anything out of them. Each call you make returns the difference in location since the LAST time you called it.
-In the example, when you run it, move the mouse to a location, press left mouse button. This makes the first call. Then, move the mouse and press right mouse button. The second call will return the difference since the first call and display it for you.
+Graphics 640,480
+
+SetBuffer BackBuffer()
+
+x=320
+y=240
+
+; infinite mouse movement
+
+Repeat
+Cls
+
+xs=MouseXSpeed() ; see how far the mouse has been moved
+ys=MouseYSpeed()
+MoveMouse 320,240 ;put the mouse back in the middle of the screen
+
+x=x+xs ;adjust mouse co-ords
+y=y+ys
+
+If x>GraphicsWidth()-1 Then x=x-GraphicsWidth() ;wrap screen
+If x<0 Then x=x+GraphicsWidth()
+If y<0 Then y=y+GraphicsHeight()
+If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
+
+Text x,y,"X",True,True
+
+Flip
+
+Until KeyHit(1)
+
+End
+
+
+
-; Set graphics mode and double buffering
-Graphics 800,600,16
-SetBuffer BackBuffer()
+Index
-; repeat until right mouse button is pressed
-Repeat
-Cls ; Clear screen
-Rect MouseX(),MouseY(),2,2,1 ; draw a small box where the mouse is
-; if user hits left mouse, take note of where it is and call mousexspeed/mouseyspeed
-If MouseHit(1) Then startx=MouseXSpeed():starty=MouseYSpeed()
-
-; When user hits right mouse button, record the difference between last call
-; and this call to the mousey/xspeed commands.
-If MouseHit(2) Then endx=MouseXSpeed():endy=MouseYSpeed()
-Flip ; flip screen into view
-Until endx ; end the loop when we have a value for endx
-
-; display results
-Text 0,0,"Changes in mouse coordinates: " + endx + "," + endy
-Flip ; flip changes into view
-
-; Wait for escape
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseY.htm b/_release/help/commands/2d_commands/MouseY.htm
index 763f6a9..49d96d1 100644
--- a/_release/help/commands/2d_commands/MouseY.htm
+++ b/_release/help/commands/2d_commands/MouseY.htm
@@ -1,36 +1,59 @@
-Command: MouseY() MouseY() Definition:
Returns the mouse's Y screen coordinate.
Parameter Description:
None
Command Description:
This command returns the mouse's Y location on the screen. Use this with the DrawImage command to make a custom mouse pointer, or to control something directly on the screen with the mouse. Use MouseX() to get the X coordinate.
Example:
; LoadAnimImage/MaskImage MouseX()/MouseY() Example
-; With animation timers
+
+
+Blitz3D Docs
+
+
+
+
MouseY()
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+This command returns the Y location of the mouse on the screen. This position is always from the range 0 to GraphicsHeight( ) - 1. You can use this command in combination with DrawImage to make a custom mouse pointer, or to control something on the screen directly with the mouse.
-; Even though we don't have any functions, let's do variables global
-; One variable will hold the handle for the graphic, one will hold the
-; current frame we are displaying, and one will hold the milliseconds
-; timer so we can adjust the animation speed.
-Global gfxSparks, frmSparks, tmrSparks
-; Standard graphic declaration and double buffering setup
-Graphics 640,480,16
-SetBuffer BackBuffer()
+See also: MouseX, MouseZ.
+
-; Load the imagestrip up and denote the frames 32x32 - for a total of 3 frames
-gfxSparks=LoadAnimImage("c:\Program Files\BlitzBasic\samples\Graphics\spark.bmp",32,32,0,3)
+Index
-; We mask the image's color pink to be the 'transparent' color - look at the
-; image in your favorite editor to see more why we use masking.
-MaskImage gfxSparks,255,0,255
-
-; Loop until ESC
-While Not KeyHit(1)
-Cls ; Standard clear screen
-
-; The next statment checks to see if 100 milliseconds has passes since we
-; last changed frames. Change the 100 to higher and lower values to
-; make the animation faster or slower.
-If MilliSecs() > tmrSparks + 100 Then
-tmrSparks=MilliSecs() ; 'reset' the timer
-frmSparks=( frmSparks + 1 ) Mod 3 ; increment the frame, flip to 0 if we are out
-End If
-DrawImage gfxSparks,MouseX(),MouseY(),frmSparks ; draw the image at MouseX and Y
-Flip ; show the buffer
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseYSpeed.htm b/_release/help/commands/2d_commands/MouseYSpeed.htm
index fdc9ddb..529c1c4 100644
--- a/_release/help/commands/2d_commands/MouseYSpeed.htm
+++ b/_release/help/commands/2d_commands/MouseYSpeed.htm
@@ -1,31 +1,73 @@
-Command: MouseYSpeed() MouseYSpeed() Definition:
Returns the changes in the mouse location since the LAST call to the command.
Parameter Description:
None.
Command Description:
Often you'd like to find the difference between where the mouse WAS to where it is NOW. You can use this command and MouseXSpeed() in pairs to find out the changes in the mouse location between calls.
+
+
+Blitz3D Docs
+
+
+
+
MouseYSpeed()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Often you'd like to find the difference between where the mouse WAS to where it is NOW. You can use this command and MouseYSpeed() in pairs to find out the changes in the mouse location between calls.
+
+You really have to use these commands TWICE to get anything out of them. Each call you make returns the difference in location since the LAST time you called it.
+
+In this example it's called every loop and therefore allows you to have infinite mouse movement without the screen size restrictions.
-You really have to use these commands TWICE to get anything out of them. Each call you make returns the difference in location since the LAST time you called it.
-In the example, when you run it, move the mouse to a location, press left mouse button. This makes the first call. Then, move the mouse and press right mouse button. The second call will return the difference since the first call and display it for you.
+Graphics 640,480
+
+SetBuffer BackBuffer()
+
+x=320
+y=240
+
+; infinite mouse movement
+
+Repeat
+Cls
+
+xs=MouseXSpeed() ; see how far the mouse has been moved
+ys=MouseYSpeed()
+MoveMouse 320,240 ;put the mouse back in the middle of the screen
+
+x=x+xs ;adjust mouse co-ords
+y=y+ys
+
+If x>GraphicsWidth()-1 Then x=x-GraphicsWidth() ;wrap screen
+If x<0 Then x=x+GraphicsWidth()
+If y<0 Then y=y+GraphicsHeight()
+If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
+
+Text x,y,"X",True,True
+
+Flip
+
+Until KeyHit(1)
+
+End
+
+
+
-; Set graphics mode and double buffering
-Graphics 800,600,16
-SetBuffer BackBuffer()
+Index
-; repeat until right mouse button is pressed
-Repeat
-Cls ; Clear screen
-Rect MouseX(),MouseY(),2,2,1 ; draw a small box where the mouse is
-; if user hits left mouse, take note of where it is and call mousexspeed/mouseyspeed
-If MouseHit(1) Then startx=MouseXSpeed():starty=MouseYSpeed()
-
-; When user hits right mouse button, record the difference between last call
-; and this call to the mousey/xspeed commands.
-If MouseHit(2) Then endx=MouseXSpeed():endy=MouseYSpeed()
-Flip ; flip screen into view
-Until endx ; end the loop when we have a value for endx
-
-; display results
-Text 0,0,"Changes in mouse coordinates: " + endx + "," + endy
-Flip ; flip changes into view
-
-; Wait for escape
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseZ.htm b/_release/help/commands/2d_commands/MouseZ.htm
index fd6962d..cf275fd 100644
--- a/_release/help/commands/2d_commands/MouseZ.htm
+++ b/_release/help/commands/2d_commands/MouseZ.htm
@@ -1,46 +1,48 @@
-Command: MouseZ
-
-
+Blitz3D Docs
+
-
-
-
MouseZ
-
-
-Parameters:
-
-
-
-
n/a
-
-
-
Description:
-
-
-
-
MouseZ returns the current position of the mousewheel on a suitable mouse. It starts off at zero when your program begins. The value of MouseZ increases as you move the wheel away from you and decreases as you move it towards you.
+MouseZ returns the current position of the mouse wheel on a suitable mouse. It starts off at zero when your program begins. The value of MouseZ increases as you move the wheel away from you and decreases as you move it towards you.
+
+
+See also: MouseX, MouseY.
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MouseZSpeed.htm b/_release/help/commands/2d_commands/MouseZSpeed.htm
index e674702..d14b0f7 100644
--- a/_release/help/commands/2d_commands/MouseZSpeed.htm
+++ b/_release/help/commands/2d_commands/MouseZSpeed.htm
@@ -1,60 +1,59 @@
-Command: MouseZSpeed
-
-
+Blitz3D Docs
+
-
-
-
MouseZSpeed
-
-
-Parameters:
-
-
-
-
n/a
-
-
-
Description:
-
-
-
-
MouseZSpeed returns -1 if the mousewheel on a suitable mouse is being rolled backwards (towards user), 0 if it is not being moved, and 1 if it is being rolled forwards.
-Graphics 640, 480, 0, 2
-SetBuffer BackBuffer ()
-
-Repeat
-
- Cls
-
- Select MouseZSpeed ()
- Case -1
- result$ = "Backwards"
- Case 0
- ; result$ = "No movement"
- Case 1
- result$ = "Forwards"
- End Select
-
- Text 20, 10, "NOTE: MouseZSpeed () = 0 is not listed here, to avoid confusion!"
- Text 20, 40, result$
- Flip
-
-Until KeyHit (1)
-
-End
+
MouseZSpeed()
+
Parameters
+
+
+
+None.
-
+
-
+
Description
+
+
+
+MouseZSpeed returns -1 if the mousewheel on a suitable mouse is being rolled backwards (towards user), 0 if it is not being moved, and 1 if it is being rolled forwards.
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/MoveMouse.htm b/_release/help/commands/2d_commands/MoveMouse.htm
index 874e513..cb0bb0e 100644
--- a/_release/help/commands/2d_commands/MoveMouse.htm
+++ b/_release/help/commands/2d_commands/MoveMouse.htm
@@ -1,15 +1,57 @@
-Command: MoveMouse MoveMouse x,y Definition:
Moves the mouse pointer to a designated location on the screen.
Parameter Description:
x = the x coordinate on the screen to move the mouse
-y = the y coordinate on the screen to move the mouse
Command Description:
Although the mouse isn't visible on the screen, the mouse location is still being tracked and you can attach a graphic to it. However, there are times when you want to put the pointer to a specific location on the screen. Use this command to move the mouse to a designated location.
Example:
; MoveMouse Example
+
+
+Blitz3D Docs
+
+
+
+
MoveMouse x,y
+
Parameters
+
+
+
+x = the x coordinate on the screen to move the mouse
+y = the y coordinate on the screen to move the mouse
+
+
+
+
Description
+
+
+
+Although the mouse isn't visible on the screen, the mouse location is still being tracked and you can attach a graphic to it. However, there are times when you want to put the pointer to a specific location on the screen. Use this command to move the mouse to a designated location.
+
-Graphics 640,480
-For t = 1 To 2
-Print "Move the mouse around and push the left button."
-WaitMouse()
-Print "The mouse is currently located at: " + MouseX() + "," + MouseY() + "."
-Next
-Print "Now I'll move the mouse ..."
-MoveMouse 320,320
-Print "The mouse is NOW located at: " + MouseX() + "," + MouseY() + "."
-Print "Click mouse button to quit."
-WaitMouse()
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/NetMsgData.htm b/_release/help/commands/2d_commands/NetMsgData.htm
index 99891a8..407dab3 100644
--- a/_release/help/commands/2d_commands/NetMsgData.htm
+++ b/_release/help/commands/2d_commands/NetMsgData.htm
@@ -1,48 +1,83 @@
-Command: NetMsgData$() NetMsgData$() Definition:
Returns the actual message of a network message.
Parameter Description:
None.
Command Description:
First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk). You must've received the message already, determined by the RecvNetMsg() command - and probably determined the type of message with (NetMsgType().
+
+
+Blitz3D Docs
+
+
+
+
NetMsgData$()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk). You must've received the message already, determined by the RecvNetMsg() command - and probably determined the type of message with (NetMsgType().
+
+The string value returned from this command is the actual message text that was sent.
+
+You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
+
+The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
+
+; NetMsgData$() example
+; --------------------
+; Run this program on the REMOTE computer to 'watch'
+; the activity of the SendNetMsg example. Run that
+; example on local machine.
+;
+; This program will tell you when a player involved in
+; the game hits a wall ...
+
+; We'll use this instead of JoinHostGame - make it easier
+StartNetGame()
+
+; Create a player - a player must be created to
+; receive mesages!
+playerID=CreateNetPlayer("Shane")
+
+; Loop and get status
+While Not KeyHit(1)
+
+; Check to see if we've received a message
+If RecvNetMsg() Then
+
+; if we did, let's figure out what type it is
+; we know it will be a user message, though
+msgType=NetMsgType()
+
+; 1-99 means a user message
+If msgType>0 And msgType<100 Then
+
+; Let's see who the message was from
+msgFrom=NetMsgFrom()
+
+; Let's get the message!
+msgData$=NetMsgData$()
+
+; Print the message
+Print msgData$
+Print "(Message was to:"+ NetMsgTo() + ")"
+End If
+End If
+Wend
+
+
+
+
-The string value returned from this command is the actual message text that was sent.
+Index
-You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
-
-The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
Example:
; NetMsgData$() example
-; --------------------
-; Run this program on the REMOTE computer to 'watch'
-; the activity of the SendNetMsg example. Run that
-; example on local machine.
-;
-; This program will tell you when a player involved in
-; the game hits a wall ...
-
-; We'll use this instead of JoinHostGame - make it easier
-StartNetGame()
-
-; Create a player - a player must be created to
-; receive mesages!
-playerID=CreateNetPlayer("Shane")
-
-; Loop and get status
-While Not KeyHit(1)
-
-; Check to see if we've received a message
-If RecvNetMsg() Then
-
-; if we did, let's figure out what type it is
-; we know it will be a user message, though
-msgType=NetMsgType()
-
- ; 1-99 means a user message
- If msgType>0 And msgType<100 Then
-
- ; Let's see who the message was from
- msgFrom=NetMsgFrom()
-
- ; Let's get the message!
- msgData$=NetMsgData$()
-
- ; Print the message
- Print msgData$
- Print "(Message was to:"+ NetMsgTo() + ")"
- End If
-End If
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/NetPlayerLocal.htm b/_release/help/commands/2d_commands/NetPlayerLocal.htm
index cb877fc..d314282 100644
--- a/_release/help/commands/2d_commands/NetPlayerLocal.htm
+++ b/_release/help/commands/2d_commands/NetPlayerLocal.htm
@@ -1,51 +1,85 @@
-Command: NetPlayerLocal NetPlayerLocal (playerID) Definition:
Determines if the player is on the local machine.
Parameter Description:
playerID = a valid player ID number (get from the NetMsgFrom() command)
Command Description:
First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
-
-Use this command in conjunction with the NetMsgFrom() (to get the player's ID) command to check and see if the player in question is on the local machine (as opposed to a remote machine). You may wish to act differently in your program based on whether the message that came in was from a local or remote machine.
-
-You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
-
-The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
Example:
; NetPlayerLocal example
-; --------------------
-; Run this program on the REMOTE computer to 'watch'
-; the activity of the SendNetMsg example. Run that
-; example on local machine.
-;
-; This program will tell you when a player involved in
-; the game hits a wall ...
-
-; We'll use this instead of JoinHostGame - make it easier
-StartNetGame()
-
-; Create a player - a player must be created to
-; receive mesages!
-playerID=CreateNetPlayer("Shane")
-
-; Loop and get status
-While Not KeyHit(1)
-
-; Check to see if we've received a message
-If RecvNetMsg() Then
-
-; if we did, let's figure out what type it is
-; we know it will be a user message, though
-msgType=NetMsgType()
-
- ; 1-99 means a user message
- If msgType>0 And msgType<100 Then
-
- ; Let's see who the message was from
- msgFrom=NetMsgFrom()
-
- ; Let's get the message!
- msgData$=NetMsgData$()
-
- ; Print the message
- Print msgData$
-if NetPlayerLocal(NetMsgFrom()) then
-print "(This was sent from a local player)"
-end if
+
+
+Blitz3D Docs
+
+
+
+
NetPlayerLocal (playerID)
+
Parameters
+
+
+
+playerID = a valid player ID number (get from the NetMsgFrom() command)
+
+
+
+
Description
+
+
+
+First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+Use this command in conjunction with the NetMsgFrom() (to get the player's ID) command to check and see if the player in question is on the local machine (as opposed to a remote machine). You may wish to act differently in your program based on whether the message that came in was from a local or remote machine.
+
+You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
+
+The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
+
+; NetPlayerLocal example
+; --------------------
+; Run this program on the REMOTE computer to 'watch'
+; the activity of the SendNetMsg example. Run that
+; example on local machine.
+;
+; This program will tell you when a player involved in
+; the game hits a wall ...
+
+; We'll use this instead of JoinHostGame - make it easier
+StartNetGame()
+
+; Create a player - a player must be created to
+; receive mesages!
+playerID=CreateNetPlayer("Shane")
+
+; Loop and get status
+While Not KeyHit(1)
+
+; Check to see if we've received a message
+If RecvNetMsg() Then
+
+; if we did, let's figure out what type it is
+; we know it will be a user message, though
+msgType=NetMsgType()
+
+; 1-99 means a user message
+If msgType>0 And msgType<100 Then
+
+; Let's see who the message was from
+msgFrom=NetMsgFrom()
+
+; Let's get the message!
+msgData$=NetMsgData$()
+
+; Print the message
+Print msgData$
+if NetPlayerLocal(NetMsgFrom()) then
+print "(This was sent from a local player)"
+end if
+End If
+End If
+Wend
- End If
-End If
-Wend
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/NetPlayerName.htm b/_release/help/commands/2d_commands/NetPlayerName.htm
index d662ac1..c462732 100644
--- a/_release/help/commands/2d_commands/NetPlayerName.htm
+++ b/_release/help/commands/2d_commands/NetPlayerName.htm
@@ -1,48 +1,83 @@
-Command: NetPlayerName$ NetPlayerName$ (playerID) Definition:
Returns the actual name of the player in a network game.
Parameter Description:
playerID = a valid player ID number (get from the NetMsgFrom() command
Command Description:
First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+
+Blitz3D Docs
+
+
+
+
NetPlayerName$ (playerID)
+
Parameters
+
+
+
+playerID = a valid player ID number (get from the NetMsgFrom() command
+
+
+
+
Description
+
+
+
+First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+Use this command in conjunction with the NetMsgFrom() (to get the player's ID) command to derive the actual name of the player. This command returns a string value.
+
+You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
+
+The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
+
+; NetPlayerName$() example
+; --------------------
+; Run this program on the REMOTE computer to 'watch'
+; the activity of the SendNetMsg example. Run that
+; example on local machine.
+;
+; This program will tell you when a player involved in
+; the game hits a wall ...
+
+; We'll use this instead of JoinHostGame - make it easier
+StartNetGame()
+
+; Create a player - a player must be created to
+; receive mesages!
+playerID=CreateNetPlayer("Shane")
+
+; Loop and get status
+While Not KeyHit(1)
+
+; Check to see if we've received a message
+If RecvNetMsg() Then
+
+; if we did, let's figure out what type it is
+; we know it will be a user message, though
+msgType=NetMsgType()
+
+; 1-99 means a user message
+If msgType>0 And msgType<100 Then
+
+; Let's see who the message was from
+msgFrom=NetMsgFrom()
+
+; Let's get the message!
+msgData$=NetMsgData$()
+
+; Print the message
+Print msgData$
+Print "(Message was from:"+ NetPlayerName$(NetMsgFrom()) + ")"
+End If
+End If
+Wend
+
+
+
+
-Use this command in conjunction with the NetMsgFrom() (to get the player's ID) command to derive the actual name of the player. This command returns a string value.
+Index
-You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
-
-The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
Example:
; NetPlayerName$() example
-; --------------------
-; Run this program on the REMOTE computer to 'watch'
-; the activity of the SendNetMsg example. Run that
-; example on local machine.
-;
-; This program will tell you when a player involved in
-; the game hits a wall ...
-
-; We'll use this instead of JoinHostGame - make it easier
-StartNetGame()
-
-; Create a player - a player must be created to
-; receive mesages!
-playerID=CreateNetPlayer("Shane")
-
-; Loop and get status
-While Not KeyHit(1)
-
-; Check to see if we've received a message
-If RecvNetMsg() Then
-
-; if we did, let's figure out what type it is
-; we know it will be a user message, though
-msgType=NetMsgType()
-
- ; 1-99 means a user message
- If msgType>0 And msgType<100 Then
-
- ; Let's see who the message was from
- msgFrom=NetMsgFrom()
-
- ; Let's get the message!
- msgData$=NetMsgData$()
-
- ; Print the message
- Print msgData$
- Print "(Message was from:"+ NetPlayerName$(NetMsgFrom()) + ")"
- End If
-End If
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/New.htm b/_release/help/commands/2d_commands/New.htm
index 54e2e3c..8d328b2 100644
--- a/_release/help/commands/2d_commands/New.htm
+++ b/_release/help/commands/2d_commands/New.htm
@@ -1,22 +1,58 @@
-Command: New New type_variable Definition:
Create a new TYPE object in the Type collection.
Parameter Description:
type_variable = the actual Type name, not the custom Type name
Command Description:
If you aren't familiar with the TYPE command, please refer to that before reading about this command.
+
+
+Blitz3D Docs
+
+
+
+
New type_variable
+
Parameters
+
+
+
+type_variable = the actual Type name, not the custom Type name
+
+
+
+
Description
+
+
+
+If you aren't familiar with the TYPE command, please refer to that before reading about this command.
+
+Creates a NEW object in a Type collection. Each call to this command automatically inserts a new object into the specified Type collection. Check the example and other Type commands for more information.
-Creates a NEW object in a Type collection. Each call to this command automatically inserts a new object into the specified Type collection. Check the example and other Type commands for more information.
+; Define the CHAIR Type
+
+Type CHAIR
+Field X
+Field Y
+Field HEIGHT
+End Type
+
+; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
+
+For tempx = 1 to 10
+For tempy = 1 to 10
+room.chair = New Chair
+room\x = tempx
+room\y = tempy
+room\height = Rnd(0,10) ; set a random height 0 to 10
+Next
+Next
+
+
+
-; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
+Index
-For tempx = 1 to 10
-For tempy = 1 to 10
-room.chair = New Chair
-room\x = tempx
-room\y = tempy
-room\height = Rnd(0,10) ; set a random height 0 to 10
-Next
-Next
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Next.htm b/_release/help/commands/2d_commands/Next.htm
index 3b12a53..0afdd86 100644
--- a/_release/help/commands/2d_commands/Next.htm
+++ b/_release/help/commands/2d_commands/Next.htm
@@ -1,2 +1,46 @@
-Command: Next Next Definition:
The closing command of a FOR ... NEXT loop.
Parameter Description:
None
Command Description:
This command closes the FOR ... NEXT loop, causing program execution to start again at the FOR command unless the loop condition has been met (the last value has been met). Check the example for more info. Note: Do NOT use the FOR command's variable as a parameter (i.e. NEXT T) as you would in most BASIC languages. Blitz will automatically match it with the nearest FOR command.
Example:
; Print the values 1 through 10 For t = 1 To 10 Print t Next ; Print the values 1,3,5,7,9 For t = 1 To 10 Step 2 Print t Next
+This command closes the FOR ... NEXT loop, causing program execution to start again at the FOR command unless the loop condition has been met (the last value has been met). Check the example for more info. Note: Do NOT use the FOR command's variable as a parameter (i.e. NEXT T) as you would in most BASIC languages. Blitz will automatically match it with the nearest FOR command.
+
+
+See also: For, To, Step, Each, Exit, While, Repeat.
+
+; Print the values 1 through 10
+For t = 1 To 10
+Print t
+Next
+; Print the values 1,3,5,7,9
+For t = 1 To 10 Step 2
+Print t
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/NextFile.htm b/_release/help/commands/2d_commands/NextFile.htm
index 1c135d4..84e7a23 100644
--- a/_release/help/commands/2d_commands/NextFile.htm
+++ b/_release/help/commands/2d_commands/NextFile.htm
@@ -1,31 +1,64 @@
-Command: NextFile$ NextFile$ (filehandle) Definition:
Retrieves the next file/folder from a directory opened with the ReadDir command.
Parameter Description:
filehandle = valid filehandle assigned from the ReadDir command
Command Description:
This command will return the NEXT file or folder from the currently open directory (use ReadDir to open the desired folder for reading). This will return a string containing the folder name or the filename plus extention. Use FILETYPE to determine if it is a file or folder. See ReadDir and CloseDir for more. You cannot move 'backwards' through a directory, only forward. You might want to parse the contents of a directory into an array for display, processing, etc.
+filehandle = valid filehandle assigned from the ReadDir command
+
+
+
+
Description
+
+
+
+This command will return the NEXT file or folder from the currently open directory (use ReadDir to open the desired folder for reading). This will return a string containing the folder name or the filename plus extention. Use FILETYPE to determine if it is a file or folder. See ReadDir and CloseDir for more. You cannot move 'backwards' through a directory, only forward. You might want to parse the contents of a directory into an array for display, processing, etc.
+
+; ReadDir/NextFile$/CloseDir example
+
+; Define what folder to start with ...
+folder$="C:"
+
+; Open up the directory, and assign the handle to myDir
+myDir=ReadDir(folder$)
+
+; Let's loop forever until we run out of files/folders to list!
+Repeat
+; Assign the next entry in the folder to file$
+file$=NextFile$(myDir)
+
+; If there isn't another one, let's exit this loop
+If file$="" Then Exit
+
+; Use FileType to determine if it is a folder (value 2) or a file and print results
+If FileType(folder$+"\"+file$) = 2 Then
+Print "Folder:" + file$
+Else
+Print "File:" + file$
+End If
+Forever
+
+; Properly close the open folder
+CloseDir myDir
+
+; We're done!
+Print "Done listing files!"
+
+
+
-; Define what folder to start with ...
-folder$="C:\"
+Index
-; Open up the directory, and assign the handle to myDir
-myDir=ReadDir(folder$)
-
-; Let's loop forever until we run out of files/folders to list!
-Repeat
-; Assign the next entry in the folder to file$
-file$=NextFile$(myDir)
-
-; If there isn't another one, let's exit this loop
-If file$="" Then Exit
-
-; Use FileType to determine if it is a folder (value 2) or a file and print results
-If FileType(folder$+"\"+file$) = 2 Then
-Print "Folder:" + file$
-Else
-Print "File:" + file$
-End If
-Forever
-
-; Properly close the open folder
-CloseDir myDir
-
-; We're done!
-Print "Done listing files!"
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Not.htm b/_release/help/commands/2d_commands/Not.htm
index addfe7d..20e739a 100644
--- a/_release/help/commands/2d_commands/Not.htm
+++ b/_release/help/commands/2d_commands/Not.htm
@@ -1,8 +1,44 @@
-Command: Not Not Definition:
Logical operator NOT to test a condition to be false.
Parameter Description:
None.
Command Description:
The NOT operator is used to determine if a condition is FALSE instead of TRUE. This is frequently used in WHILE loops and IF statements to check for the NON-EXISTANCE of an event or value. We use NOT frequently in our examples, inside WHILE loops to test if the ESC key has been pressed.
Example:
; NOT example
+
+
+Blitz3D Docs
+
+
+
+
Not
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+The NOT operator is used to determine if a condition is FALSE instead of TRUE. This is frequently used in WHILE loops and IF statements to check for the NON-EXISTANCE of an event or value. We use NOT frequently in our examples, inside WHILE loops to test if the ESC key has been pressed.
-; Loop until they press ESC
-While Not KeyHit(1) ; As long as ESC isn't pressed ...
-Print "Press ESC to quit!"
-Wend
-
+; NOT example
+
+; Loop until they press ESC
+While Not KeyHit(1) ; As long as ESC isn't pressed ...
+Print "Press ESC to quit!"
+Wend
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Null.htm b/_release/help/commands/2d_commands/Null.htm
index 72f6b92..5bba822 100644
--- a/_release/help/commands/2d_commands/Null.htm
+++ b/_release/help/commands/2d_commands/Null.htm
@@ -1,8 +1,51 @@
-Command: Null Null Definition:
Indicates a null or empty value.
Parameter Description:
None
Command Description:
Designates a null value. Useful for erasing a variable or testing if a variable has a value at all.
Example:
; Null example
+
+
+Blitz3D Docs
+
+
+
+
Null
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+Designates a Null Type object. Useful for making a Type variable point to nothing or checking if a Type object exists. Also, useful for checking that there are still objects left on the end of a Type list using the After command.
+
+
+Can used for testing and setting.
-strHello$="Hello"
+; Null example
+
+Type Alien
+Field x,y
+End Type
+
+a.Alien = New Alien
+If a <> Null Then Print "Alien exists!"
+Delete a
+if a = Null Then Print "Alien gone!"
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/OpenFile.htm b/_release/help/commands/2d_commands/OpenFile.htm
index 8498a33..0208678 100644
--- a/_release/help/commands/2d_commands/OpenFile.htm
+++ b/_release/help/commands/2d_commands/OpenFile.htm
@@ -1,49 +1,82 @@
-Command: OpenFile OpenFile (filename$) Definition:
Opens a file on disk for both reading and writing operations i.e. for update.
Parameter Description:
filename$ = any valid path and filename. The returned value is the filehandle which is used by other file handling
-commands.
Command Description:
This command opens the designated file and prepares it to be updated. The file must exists since this function will not create a new file.
+
+
+Blitz3D Docs
+
+
+
+
OpenFile (filename$)
+
Parameters
+
+
+
+filename$ = any valid path and filename. The returned value is the filehandle which is used by other file handling commands.
+
+
+
+
Description
+
+
+
+This command opens the designated file and prepares it to be updated. The file must exists since this function will not create a new file.
+
+By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working through the whole file sequentially. This could be useful if you have created a database file and you want to find and update just a few records within it.
+
+The file handle that is returned is an integer value that the operating system uses to identify which file is to be read and written to and must be passed to the functions such as ReadInt() and WriteInt().
+
+Note extreme care needs to be exercised when updating files that contain strings since these are not fixed in length.
-By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working
-through the whole file sequentially. This could be useful if you have created a database file and you want to find and update just a few records within it.
-The file handle that is returned is an integer value that the operating system uses to identify which file is to be read and written to and must be passed to the functions such as ReadInt() and WriteInt().
+See also: ReadFile, WriteFile, CloseFile, SeekFile.
+
+; Changing part of a file using OpenFile, SeekFile and WriteInt
+
+; Open/create a file to Write
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteInt( fileout, 1 )
+WriteInt( fileout, 2 )
+WriteInt( fileout, 3 )
+WriteInt( fileout, 4 )
+WriteInt( fileout, 5 )
+
+; Close the file
+CloseFile( fileout )
+
+DisplayFile( "The file as originally written", mydata.dat" )
+; Open the file and change the Third Integer
+
+file = OpenFile("mydata.dat")
+SeekFile( file, 8 ) ; Move to the third integer in the file
+WriteInt( file, 9999 ) ; Replace the original value with 9999
+CloseFile( file )
+
+DisplayFile( "The file after being midified", "mydata.dat" )
+WaitKey()
+; **** Function Definitions follow ****
+
+; Read the file and print it
+Function DisplayFile( Tittle$, Filename$ )
+Print tittle$
+filein = ReadFile( Filename$ )
+While Not Eof( filein )
+Number = ReadInt( filein )
+Print Number
+Wend
+CloseFile( filein )
+Print
+End Function
+
; Changing part of a file using OpenFile, SeekFile and WriteInt
+Index
-; Open/create a file to Write
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteInt( fileout, 1 )
-WriteInt( fileout, 2 )
-WriteInt( fileout, 3 )
-WriteInt( fileout, 4 )
-WriteInt( fileout, 5 )
-
-; Close the file
-CloseFile( fileout )
-
-DisplayFile( "The file as originally written", mydata.dat" )
-; Open the file and change the Third Integer
-
-file = OpenFile("mydata.dat")
-SeekFile( file, 8 ) ; Move to the third integer in the file
-WriteInt( file, 9999 ) ; Replace the original value with 9999
-CloseFile( file )
-
-DisplayFile( "The file after being midified", "mydata.dat" )
-WaitKey()
-; **** Function Definitions follow ****
-
-; Read the file and print it
-Function DisplayFile( Tittle$, Filename$ )
- Print tittle$
- filein = ReadFile( Filename$ )
- While Not Eof( filein )
- Number = ReadInt( filein )
- Print Number
- Wend
- CloseFile( filein )
- Print
-End Function
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/OpenTCPStream.htm b/_release/help/commands/2d_commands/OpenTCPStream.htm
index 530203a..1a88bc3 100644
--- a/_release/help/commands/2d_commands/OpenTCPStream.htm
+++ b/_release/help/commands/2d_commands/OpenTCPStream.htm
@@ -1,32 +1,67 @@
-Command: OpenTCPStream OpenTCPStream (ip$,port) Definition:
Opens a client TCP stream to the specified server.
Parameter Description:
ip$=Address of stream
-port=TCP/IP Port Number
Command Description:
Use this command to open up a TCP/IP stream to the designated server and port. If the open command was successful, the command returns a stream handle. Otherwise it returns 0.
+
+
+Blitz3D Docs
+
+
+
+
OpenTCPStream (ip$,port)
+
Parameters
+
+
+
+ip$=Address of stream
+port=TCP/IP Port Number
+
+
+
+
Description
+
+
+
+Use this command to open up a TCP/IP stream to the designated server and port. If the open command was successful, the command returns a stream handle. Otherwise it returns 0.
+
+You can use this for a multitude of different 'internet' options. Obviously to contact a TCP/IP host outside your own network, you'll need to be connected to the Internet.
+
+The IP address can be in the form of 1.2.3.4 or "www.domain.com".
+
-You can use this for a multitude of different 'internet' options. Obviously to contact a TCP/IP host outside your own network, you'll need to be connected to the Internet.
+Index
-The IP address can be in the form of 1.2.3.4 or "www.domain.com".
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Or.htm b/_release/help/commands/2d_commands/Or.htm
index 60b8d9d..adc6826 100644
--- a/_release/help/commands/2d_commands/Or.htm
+++ b/_release/help/commands/2d_commands/Or.htm
@@ -1,10 +1,46 @@
-Command: Or Or Definition:
Conjunction between two values to derive a boolean value.
Parameter Description:
None
Command Description:
A logical expression to return a boolean TRUE or FALSE comparison of expressions or values. Use this to check two expressions or more and act upon its return value. See the example.
Example:
; OR Example
+
+
+Blitz3D Docs
+
+
+
+
Or
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+A logical expression to return a boolean TRUE or FALSE comparison of expressions or values. Use this to check two expressions or more and act upon its return value. See the example.
-myNum1=Rnd(0,10)
-myNum2=Rnd(0,10)
-If myNum1 = 0 OR myNum2 = 0 then
-print "One of my numbers is a Zero"
-end if
-
+; OR Example
+
+myNum1=Rnd(0,10)
+myNum2=Rnd(0,10)
+
+If myNum1 = 0 OR myNum2 = 0 then
+print "One of my numbers is a Zero"
+end if
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Origin.htm b/_release/help/commands/2d_commands/Origin.htm
index 63d4446..0ea03a1 100644
--- a/_release/help/commands/2d_commands/Origin.htm
+++ b/_release/help/commands/2d_commands/Origin.htm
@@ -1,14 +1,49 @@
-Command: Origin Origin x,y Definition:
Allows you to offset all drawing commands from a designated location.
Parameter Description:
x = x offset value
-y = y offset value
Command Description:
This command sets a point of origin for all subsequent drawing commands. This can be positive or negative.
+; Origin example
+Graphics 800,600,16
+
+; Offset drawing options with origin command -200 in each direction
+Origin -200,-200
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+
+; Draw an oval - SHOULD be at the exact center, but it isn't!
+Oval 400,300,50,50,1
+Wend
+
+
+
+
-; Offset drawing options with origin command -200 in each direction
-Origin -200,-200
+Index
-; Wait for ESC to hit
-While Not KeyHit(1)
-
-; Draw an oval - SHOULD be at the exact center, but it isn't!
-Oval 400,300,50,50,1
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Oval.htm b/_release/help/commands/2d_commands/Oval.htm
index bc33993..67c6804 100644
--- a/_release/help/commands/2d_commands/Oval.htm
+++ b/_release/help/commands/2d_commands/Oval.htm
@@ -1,15 +1,50 @@
-Command: Oval Oval x,y,width,height[,solid] Definition:
Draws an oval at the designated location on the screen.
Parameter Description:
x = x coordinate on the screen to draw the oval
-y = y coordinate on the screen to draw the oval
-width = how wide to make the oval
-height = how high to make the oval
-[solid] = 1 to make the oval solid
Command Description:
Use this to draw an oval shape at the screen coordinates of your choice. You can make the oval solid or hollow.
+x = x coordinate on the screen to draw the oval
+y = y coordinate on the screen to draw the oval
+width = how wide to make the oval
+height = how high to make the oval
+[solid] = 1 to make the oval solid
+
+
+
+
Description
+
+
+
+Use this to draw an oval shape at the screen coordinates of your choice. You can make the oval solid or hollow.
+
+; Oval example
+Graphics 800,600,16
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+; Set a random color
+Color Rnd(255),Rnd(255),Rnd(255)
+; Draw a random oval
+Oval Rnd(800),Rnd(600),Rnd(100),Rnd(100),Rnd(0,1)
+Wend
+
+
+
+
-; Wait for ESC to hit
-While Not KeyHit(1)
-; Set a random color
-Color Rnd(255),Rnd(255),Rnd(255)
-; Draw a random oval
-Oval Rnd(800),Rnd(600),Rnd(100),Rnd(100),Rnd(0,1)
-Wend
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PauseChannel.htm b/_release/help/commands/2d_commands/PauseChannel.htm
index bb8ccd7..00d105c 100644
--- a/_release/help/commands/2d_commands/PauseChannel.htm
+++ b/_release/help/commands/2d_commands/PauseChannel.htm
@@ -1,42 +1,76 @@
-Command: PauseChannel PauseChannel channel_handle Definition:
Pauses the playing of a sound channel.
Parameter Description:
channel_handle = variable assigned to the channel when played
-
Command Description:
When you are playing a sound channel, there may come a time you wish to pause the sound for whatever reason (like to play another sound effect). This command does this - and the channel can be resumed with the ResumeChannel command. You can use StopChannel to actually halt the sound. This works with any channel playback (WAV, MP3, MIDI, etc.).
Example:
; Channel examples
+
+
+Blitz3D Docs
+
+
+
+
PauseChannel channel_handle
+
Parameters
+
+
+
+channel_handle = variable assigned to the channel when played
+
+
+
+
Description
+
+
+
+When you are playing a sound channel, there may come a time you wish to pause the sound for whatever reason (like to play another sound effect). This command does this - and the channel can be resumed with the ResumeChannel command. You can use StopChannel to actually halt the sound. This works with any channel playback (WAV, MP3, MIDI, etc.).
+
+; Channel examples
+
+Print "Loading sound ..."
+; Load the sample - you'll need to point this to a sound on your computer
+; For best results, make it about 5-10 seconds...
+sndWave=LoadSound("level1.wav")
+; Prepare the sound for looping
+LoopSound sndWave
+
+chnWave=PlaySound(sndWave)
+
+Print "Playing sound for 2 seconds ..."
+Delay 2000
+
+Print "Pausing sound for 2 seconds ..."
+PauseChannel chnWave
+Delay 2000
+
+Print "Restarting sound ..."
+ResumeChannel chnWave
+Delay 2000
+
+Print "Changing Pitch of sound ..."
+;StopChannel chnWave
+ChannelPitch chnWave, 22000
+Delay 2000
+
+Print "Playing new pitched sound ..."
+Delay 2000
+
+Print "Left speaker only"
+ChannelPan chnWave,-1
+Delay 2000
+
+Print "Right speaker only"
+ChannelPan chnWave,1
+Delay 2000
+
+Print "All done!"
+StopChannel chnWave
+
+
+
+
-Print "Loading sound ..."
-; Load the sample - you'll need to point this to a sound on your computer
-; For best results, make it about 5-10 seconds...
-sndWave=LoadSound("level1.wav")
-; Prepare the sound for looping
-LoopSound sndWave
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PeekByte.htm b/_release/help/commands/2d_commands/PeekByte.htm
index dcd11cb..53bda22 100644
--- a/_release/help/commands/2d_commands/PeekByte.htm
+++ b/_release/help/commands/2d_commands/PeekByte.htm
@@ -1,22 +1,57 @@
-Command: PeekByte PeekByte bank,offset Definition:
Reads a byte from a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to read the value
-
+bank - bank handle
+offset - offset in bytes, that the peek operation will be started at
+
+
+
+
Description
+
+
+
+Reads a byte from a memory bank and returns the value.
+
+A byte takes up one byte of a memory bank. Values can be in the range 0 to 255.
-bnkTest=CreateBank(500)
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PeekFloat.htm b/_release/help/commands/2d_commands/PeekFloat.htm
index 170e06f..9750cd4 100644
--- a/_release/help/commands/2d_commands/PeekFloat.htm
+++ b/_release/help/commands/2d_commands/PeekFloat.htm
@@ -1,22 +1,57 @@
-Command: PeekFloat PeekFloat bank,offset Definition:
Reads a floating point value from a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to read the value
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PeekInt.htm b/_release/help/commands/2d_commands/PeekInt.htm
index b3a0aba..6d42b2c 100644
--- a/_release/help/commands/2d_commands/PeekInt.htm
+++ b/_release/help/commands/2d_commands/PeekInt.htm
@@ -1,22 +1,57 @@
-Command: PeekInt PeekInt bank,offset Definition:
Reads an integer value from a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to read the value
-
+bank - bank handle
+offset - offset in bytes, that the peek operation will be started at
+
+
+
+
Description
+
+
+
+Reads an int from a memory bank and returns the value.
+
+An int takes up four bytes of a memory bank. Values can be in the range -2147483647 to 2147483647.
-bnkTest=CreateBank(500)
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PeekShort.htm b/_release/help/commands/2d_commands/PeekShort.htm
index b99169f..2c24684 100644
--- a/_release/help/commands/2d_commands/PeekShort.htm
+++ b/_release/help/commands/2d_commands/PeekShort.htm
@@ -1,22 +1,57 @@
-Command: PeekShort PeekShort bank,offset Definition:
Reads a short value from a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to read the value
-
+bank - bank handle
+offset - offset in bytes, that the peek operation will be started at
+
+
+
+
Description
+
+
+
+Reads a short from a memory bank and returns the value.
+
+A short takes up two bytes of a memory bank. Values can be in the range 0 to 65535.
-bnkTest=CreateBank(500)
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Pi.htm b/_release/help/commands/2d_commands/Pi.htm
index 83e85f3..5e4a0f1 100644
--- a/_release/help/commands/2d_commands/Pi.htm
+++ b/_release/help/commands/2d_commands/Pi.htm
@@ -1,5 +1,39 @@
-Command: Pi Pi Definition:
Returns the value of Pi
Parameter Description:
None
Command Description:
Returns the value of Pi to 6 digits (3.141592). Needed for geometric math routines.
Example:
; Pi example
+
+
+Blitz3D Docs
+
+
+
+
Pi
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+Returns the value of Pi to 6 digits (3.141592). Needed for geometric math routines.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PlayCDTrack.htm b/_release/help/commands/2d_commands/PlayCDTrack.htm
index 9b86431..86fd7ac 100644
--- a/_release/help/commands/2d_commands/PlayCDTrack.htm
+++ b/_release/help/commands/2d_commands/PlayCDTrack.htm
@@ -1,26 +1,58 @@
-Command: PlayCDTrack PlayCDTrack track,[mode] Definition:
Plays a CD audio track.
Parameter Description:
track = track number to play
-mode = 1; play track once, 2; loop track, 3; play track to end of CD
-
Command Description:
You can play an audio CD through Blitz Basic with this command. The optional MODE parameter allows variations of playback. Remember, the playback happens through the CD cable inside the computer that attaches to the sound card. Many computers (for some reason), don't have this cable inside properly attached. If this is the case, you will NOT hear CD sound even though you hear other sound effects and music.
+
+
+Blitz3D Docs
+
+
+
+
PlayCDTrack( track,[mode] )
+
Parameters
+
+
+
+track = track number to play
+mode = 1; play track once, 2; loop track, 3; play track to end of CD
+
+
+
+
Description
+
+
+
+Plays a CD track and returns a sound channel.
+
+The optional mode parameter allows variations of playback. Remember, the playback happens through the CD cable inside the computer that attaches to the sound card. Many computers (for some reason), don't have this cable inside properly attached. If this is the case, you will NOT hear CD sound even though you hear other sound effects and music.
+
+; PlayCDTrack example
+
+; Get a track to play from user
+track=Input$("Enter a CD track number to play:")
+
+; Play the track, assign a channel - just play once
+chnCD=PlayCDTrack(track,1)
+
+; Figure out what time it is now
+oldTime=MilliSecs()
+; Play until the channel is over or ESC
+While ChannelPlaying(chnCD) And (Not KeyHit(1))
+; clear and print the time elapsed
+Cls
+Locate 0,0
+Print "Time Elapsed (sec):" + ((MilliSecs()-oldTime)/1000)
+Wend
+
+; Stop the channel
+StopChannel chnCD
+
+
+
-You will need to assign the command a channel variable.
-; Get a track to play from user
-track=Input$("Enter a CD track number to play:")
-
-; Play the track, assign a channel - just play once
-chnCD=PlayCDTrack(track,1)
-
-; Figure out what time it is now
-oldTime=MilliSecs()
-
-; Play until the channel is over or ESC
-While ChannelPlaying(chnCD) And (Not KeyHit(1))
-; clear and print the time elapsed
-Cls
-Locate 0,0
-Print "Time Elapsed (sec):" + ((MilliSecs()-oldTime)/1000)
-Wend
-
-; Stop the channel
-StopChannel chnCD
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PlayMusic.htm b/_release/help/commands/2d_commands/PlayMusic.htm
index cc57e66..66c0792 100644
--- a/_release/help/commands/2d_commands/PlayMusic.htm
+++ b/_release/help/commands/2d_commands/PlayMusic.htm
@@ -1,10 +1,42 @@
-Command: PlayMusic PlayMusic (filename$) Definition:
Loads and begins playing a piece of music.
Parameter Description:
filename$= a valid Windows path and filename.
Command Description:
This command will load and play a .WAV. .MID, or .MP3 file (presumably for background or other type music).
+
+
+Blitz3D Docs
+
+
+
+
PlayMusic (filename$)
+
Parameters
+
+
+
+filename$ - name of music file. Formats supported: raw/mod/s3m/xm/it/mid/rmi/wav/mp2/mp3/ogg/wma/asf
+
+
+
+
Description
+
+
+
+This command will load and play a music file.
+
+You MUST use a channel variable in order to stop or adjust the music playing. You may use StopChannel, PauseChannel, ResumeChannel, etc. with this command.
+
+You can't 'preload' the audio like you can a sound sample via the LoadSound command. Every time you call the PlayMusic command, the file is reloaded and played. This means that if you use the command while some graphics are moving on-screen, you may get a slight pause when the hard drive seeks and grabs the music file. To avoid this, you might want to use the PlaySound/LoopSound commands instead.
+
-Oddly, you can't 'preload' the audio like you can a sound sample via the LoadSound command. Everytime you call the PlayMusic command, the file is RELOADED and played. Most of us aren't sure why this methodology was chosen by Blitz, but you will get a hiccup when the hard drive seeks and grabs the music file. In most cases, this will prevent you from using this command for what I'm sure it was intended for. Instead, you might want to use the LoopSound command.
-
Example:
; Load and play the background music
-
-chnBackground=PlayMusic("music\background.wav")
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PlaySound.htm b/_release/help/commands/2d_commands/PlaySound.htm
index a2d5274..fac4eae 100644
--- a/_release/help/commands/2d_commands/PlaySound.htm
+++ b/_release/help/commands/2d_commands/PlaySound.htm
@@ -1,14 +1,47 @@
-Command: PlaySound PlaySound sound_variable Definition:
Plays a sound previously loaded into memory.
Parameter Description:
sound_variable = variable previously assigned with a LoadSound command.
Command Description:
This plays a sound previously loaded and assigned to a variable using the LoadSound command. See example.
+
+
+Blitz3D Docs
+
+
+
+
PlaySound ( sound_variable )
+
Parameters
+
+
+
+sound_variable = variable previously assigned with a LoadSound command.
+
+
+
+
Description
+
+
+
+This plays a sound previously loaded and assigned to a variable using the LoadSound command. See example.
+
+You will need to assign a channel variable handle to the sound when you play it. All subsequent sound handling commands require you use the CHANNEL variable, not the sound variable to control the sound - such as StopChannel, PauseChannel, ResumeChannel, ChannelPitch, ChannelVolume, ChannelPan, and ChannelPlaying.
+
+; Assign a global variable for the sound
+Global sndPlayerDie
+
+; Load the sound file into memory
+
+sndPlayerDie=LoadSound("sounds/die.wav")
+
+; Play the sound
+
+chnDie=PlaySound ( sndPlayerDie )
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Plot.htm b/_release/help/commands/2d_commands/Plot.htm
index a06a375..8e2c8ab 100644
--- a/_release/help/commands/2d_commands/Plot.htm
+++ b/_release/help/commands/2d_commands/Plot.htm
@@ -1,7 +1,41 @@
-Command: Plot Plot x,y Definition:
Puts a single pixel on the screen in the current drawing color
Parameter Description:
x= and number from zero to the width of the current graphics mode
-y= and number from zero to the height of the current graphics mode
-
Command Description:
Used to put a pixel on the screen defined by its x, y location in the current drawing color defined by the Color command
Example:
;Set the color to green
-Color 0,255,0
-;Draw a dot at location 100,200 with the color green
-plot 100,200
+;Set the color to green
+Color 0,255,0
+
+;Draw a dot at location 100,200 with the color green
+plot 100,200
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PokeByte.htm b/_release/help/commands/2d_commands/PokeByte.htm
index 3ed4f87..64b64e0 100644
--- a/_release/help/commands/2d_commands/PokeByte.htm
+++ b/_release/help/commands/2d_commands/PokeByte.htm
@@ -1,22 +1,58 @@
-Command: PokeByte PokeByte bank,offset,value Definition:
Writes a Byte value to a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to write the value
-value = the value to be written
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PokeFloat.htm b/_release/help/commands/2d_commands/PokeFloat.htm
index 62de25b..cc89d49 100644
--- a/_release/help/commands/2d_commands/PokeFloat.htm
+++ b/_release/help/commands/2d_commands/PokeFloat.htm
@@ -1,22 +1,58 @@
-Command: PokeFloat PokeFloat bank,offset,value Definition:
Writes a floating point value to a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to write the value
-value = the value to be written
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PokeInt.htm b/_release/help/commands/2d_commands/PokeInt.htm
index fbb187c..422470f 100644
--- a/_release/help/commands/2d_commands/PokeInt.htm
+++ b/_release/help/commands/2d_commands/PokeInt.htm
@@ -1,22 +1,58 @@
-Command: PokeInt PokeInt bank,offset,value Definition:
Writes a Integer value to a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to write the value
-value = the value to be written
+bank - bank handle
+offset - offset in bytes, that the poke operation will be started at
+value - value that will be written to bank
+
+
+
+
Description
+
+
+
+Writes an int into a memory bank.
+
+An int takes up four bytes of a memory bank. Values can be in the range -2147483647 to 2147483647.
-bnkTest=CreateBank(500)
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/PokeShort.htm b/_release/help/commands/2d_commands/PokeShort.htm
index 44a9d43..9b4cab9 100644
--- a/_release/help/commands/2d_commands/PokeShort.htm
+++ b/_release/help/commands/2d_commands/PokeShort.htm
@@ -1,22 +1,58 @@
-Command: PokeShort PokeShort bank,offset,value Definition:
Writes a short value to a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-offset = offset in bytes to write the value
-value = the value to be written
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Print.htm b/_release/help/commands/2d_commands/Print.htm
index b86e609..6459c2d 100644
--- a/_release/help/commands/2d_commands/Print.htm
+++ b/_release/help/commands/2d_commands/Print.htm
@@ -1,6 +1,43 @@
-Command: Print Print string$ Definition:
Print a string to the screen.
Parameter Description:
string$ = any valid string
Command Description:
This command will print a string value on the screen (if not in a graphic mode) or on the current drawing buffer being used by the program. Unlike the Write command, it puts a carriage return/linefeed after the string.
Example:
; Get the user's name and print a welcome
+
+
+Blitz3D Docs
+
+
+
+
Print [string$]
+
Parameters
+
+
+
+string$ (optional) - string variable or value
+
+
+
+
Description
+
+
+
+Writes a string to the front buffer (i.e. the screen), and starts a new line.
+
+If the optional string parameter is omitted, then the command will just start a new line. See also: Write.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/RSet.htm b/_release/help/commands/2d_commands/RSet.htm
index c190f28..d7670bd 100644
--- a/_release/help/commands/2d_commands/RSet.htm
+++ b/_release/help/commands/2d_commands/RSet.htm
@@ -1,4 +1,39 @@
-Command: RSet$ RSet$ (string$, length) Definition:
Pads a string with spaces to a specified value, right aligning the string.
Parameter Description:
string$ = any valid string or string variable
-length = how long you want the new string to be (including padding)
Command Description:
If you have a string that is say, 10 letters long, but you want to make it a full 25 letters, padding the rest of the string with spaces, this command will do so, leaving the original string value right justified. You could use this to pad your high score names to make sure all are the same width in characters.
Example:
name$="Shane R. Monroe"
-Print "New Padded Name: '" + RSet$(name$,40) + "'"
+string$ = any valid string or string variable
+length = how long you want the new string to be (including padding)
+
+
+
+
Description
+
+
+
+If you have a string that is say, 10 letters long, but you want to make it a full 25 letters, padding the rest of the string with spaces, this command will do so, leaving the original string value right justified. You could use this to pad your high score names to make sure all are the same width in characters.
+
+name$="Shane R. Monroe"
+Print "New Padded Name: '" + RSet$(name$,40) + "'"
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Rand.htm b/_release/help/commands/2d_commands/Rand.htm
index b656278..ebfcfc8 100644
--- a/_release/help/commands/2d_commands/Rand.htm
+++ b/_release/help/commands/2d_commands/Rand.htm
@@ -1,13 +1,48 @@
-Command: Rand Rand ([low value],high value) Definition:
Generates a random integer value between the values specified.
Parameter Description:
low value = optional - defaults to 1; lowest number to generate
-high value = highest number to generate
Command Description:
Unlike the RND command, this command actually returns only integer values. The low value defaults to 1 if no value is specified. The high value is the highest number that can be randomly generated.
+
+
+Blitz3D Docs
+
+
+
+
Rand ([low value],high value)
+
Parameters
+
+
+
+low value = optional - defaults to 1; lowest number to generate
+high value = highest number to generate
+
+
+
+
Description
+
+
+
+Unlike the RND command, this command actually returns only integer values. The low value defaults to 1 if no value is specified. The high value is the highest number that can be randomly generated.
+
+If you need to generate floating point random numbers, use Rnd.
+
+; Rand example
+
+; Set the randomizer seed for more true random numbers
+SeedRnd (MilliSecs())
+
+; Generate random numbers between 1 and 100
+For t = 1 To 20
+Print Rand(1,100)
+Next
+
+
+
+
-If you need to generate floating point random numbers, use Rnd.
-; Set the randomizer seed for more true random numbers
-SeedRnd (MilliSecs())
-
-; Generate random numbers between 1 and 100
-For t = 1 To 20
-Print Rand(1,100)
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Read.htm b/_release/help/commands/2d_commands/Read.htm
index 1fa9b8d..10d2743 100644
--- a/_release/help/commands/2d_commands/Read.htm
+++ b/_release/help/commands/2d_commands/Read.htm
@@ -1,33 +1,71 @@
-Command: Read Read variable Definition:
Get the next set of values from a Data statement.
Parameter Description:
variable = valid variable to match the data type you are reading (integer, string, etc)
Command Description:
This reads the next value in a set of Data statements. This allows you to store large blocks of constant information (the structure of tile blocks for a game level for example) into easy to maintain Data statements, then retrieve them for redrawing, etc.
+
+
+Blitz3D Docs
+
+
+
+
Read variable
+
Parameters
+
+
+
+variable = valid variable to match the data type you are reading (integer, string, etc)
+
+
+
+
Description
+
+
+
+This reads the next value in a set of Data statements. This allows you to store large blocks of constant information (the structure of tile blocks for a game level for example) into easy to maintain Data statements, then retrieve them for redrawing, etc.
+
+
+Unlike most BASIC languages, Data statments do not have to be linear and sequential. Through the use of Labels (aka 'dot variable') you can create 'banks' of Data statments with the unique ability to 'Restore the Data pointer' to any one of these labels. Each level could have its own label (.level1, .level2, etc). See the Data statement, Restore command, or .Label command for more information.
+
+
+Note: You can read multiple values at one time; Read X,Y,Z for example.
-Unlike most BASIC languages, Data statments do not have to be linear and sequential. Through the use of Labels (aka 'dot variable') you can create 'banks' of Data statments with the unique ability to 'Restore the Data pointer' to any one of these labels. Each level could have its own label (.level1, .level2, etc). See the Data statement, Restore command, or .Label command for more information.
-Note: You can read multiple values at one time; Read X,Y,Z for example.
Example:
; Sample of read/restore/data/label commands
+See also: Data, Restore.
+
+; Sample of read/restore/data/label commands
+
+; Let's put the data pointer to the second data set
+Restore seconddata
+
+; Let's print them all to the screen
+For t = 1 To 10
+Read num ; Get the next data value in the data stack
+Print num
+Next
+
+; Now for the first set of data
+Restore firstdata
+
+; Let's print them all to the screen
+For t = 1 To 10
+Read num ; Get the next data value in the data stack
+Print num
+Next
+
+; this is the first set of data
+.firstdata
+Data 1,2,3,4,5,6,7,8,9,10
+
+; this is the second set of data
+.seconddata
+Data 11,12,13,14,15,16,17,18,19,20
+
+
+
-; Let's put the data pointer to the second data set
-Restore seconddata
+Index
-; Let's print them all to the screen
-For t = 1 To 10
-Read num ; Get the next data value in the data stack
-Print num
-Next
-
-; Now for the first set of data
-Restore firstdata
-
-; Let's print them all to the screen
-For t = 1 To 10
-Read num ; Get the next data value in the data stack
-Print num
-Next
-
-; this is the first set of data
-.firstdata
-Data 1,2,3,4,5,6,7,8,9,10
-
-; this is the second set of data
-.seconddata
-Data 11,12,13,14,15,16,17,18,19,20
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadAvail.htm b/_release/help/commands/2d_commands/ReadAvail.htm
index 0b3661d..9878e14 100644
--- a/_release/help/commands/2d_commands/ReadAvail.htm
+++ b/_release/help/commands/2d_commands/ReadAvail.htm
@@ -1,28 +1,62 @@
-Command: ReadAvail ReadAvail (filehandle|streamhandle) Definition:
Returns how many bytes are guaranteed to be successfully read from a stream.
Parameter Description:
filehandle|streamhandle = handle assigned to the file or stream when originally opened.
Command Description:
In the case of file streams, this reflects how much data is internally buffered. In the case of TCP streams, this reflects how much data has 'arrived'.
-
+filehandle/streamhandle = handle assigned to the file or stream when originally opened.
+
+
+
+
Description
+
+
+
+In the case of file streams, this reflects how much data is internally buffered. In the case of TCP streams, this reflects how much data has 'arrived'.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadByte.htm b/_release/help/commands/2d_commands/ReadByte.htm
index 775ce49..9b6d5d8 100644
--- a/_release/help/commands/2d_commands/ReadByte.htm
+++ b/_release/help/commands/2d_commands/ReadByte.htm
@@ -1,64 +1,96 @@
-Command: ReadByte ReadByte ( filehandle|stream ) Definition:
Reads a single byte of data from an open file (or stream) and returns it as an integer value between 0 and 255.
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to read a single byte at a time from the file/stream. Note, a byte is an integer that can take the values 0..255 and occupies 8 bits of storage. Since characters are stored as byte values this function can be used to read a file one character at a time. Reading beyond the end of file does not result in an error, but each value read will be zero.
-
-Advanced notes
-
-The number that is stored by WriteByte is actually the least significant byte of an integer so negative numbers and numbers above 255 will still have a value between 0..255. Unless you understand how 32 bit integers are stored in 2's compliment notation this will seem strange but it is NOT a
-bug.
-
+
+
+Blitz3D Docs
+
+
+
+
ReadByte ( filehandle/stream )
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to read a single byte at a time from the file/stream. Note, a byte is an integer that can take the values 0..255 and occupies 8 bits of storage. Since characters are stored as byte values this function can be used to read a file one character at a time. Reading beyond the end of file does not result in an error, but each value read will be zero.
+
+Advanced notes
+
+The number that is stored by WriteByte is actually the least significant byte of an integer so negative numbers and numbers above 255 will still have a value between 0..255. Unless you understand how 32 bit integers are stored in 2's compliment notation this will seem strange but it is NOT a bug.
+
Streams can only be used in Blitz Basic v1.52 or greater.
-See also:
-ReadByte, ReadShort, ReadInt, ReadFloat, ReadString$, ReadLine$, WriteByte, WriteShort, WriteInt, WriteFloat, WriteShort, WriteString, WriteLine, ReadFile, WriteFile, OpenFile, CloseFile, Eof, FileType, FilePos, SeekFile
Example:
; Reading and writing a file using ReadByte and WriteByte functions
+
+; Reading and writing a file using ReadByte and WriteByte functions
+
+; Initialise some variables for the example
+Byte1% = 10 ; store 10
+Byte2% = 100 ; store 100
+Byte3% = 255 ; store 255 ( the maximum value that can be stored in a Byte)
+Byte4% = 256 ; try to store 256 this will end up as 0 ( i.e. 256 - 256 = 0 )
+Byte5% = 257 ; try to store 257 this will end up as 1 ( i.e. 257 - 256 = 1 )
+Byte6% = -1 ; try to store -1 this will end up as 255 ( i.e. 256 -1 = 255 )
+Byte7% = -2 ; try to store 256 this will end up as 254 ( i.e. 256 - 2 = 254 )
+Byte8% = Asc("A") ; Store the ASCII value for the Character "A" ( i.e. 65 )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat ")
+
+; Write the information to the file
+WriteByte( fileout, Byte1 )
+WriteByte( fileout, Byte2 )
+WriteByte( fileout, Byte3 )
+WriteByte( fileout, Byte4 )
+WriteByte( fileout, Byte5 )
+WriteByte( fileout, Byte6 )
+WriteByte( fileout, Byte7 )
+WriteByte( fileout, Byte8 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1 = ReadByte( filein )
+Read2 = ReadByte( filein )
+Read3 = ReadByte( filein )
+Read4 = ReadByte( filein )
+Read5 = ReadByte( filein )
+Read6 = ReadByte( filein )
+Read7 = ReadByte( filein )
+Read8 = ReadByte( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Written - Read"
+Write Byte1 + " - " : Print Read1
+Write Byte2 + " - " : Print Read2
+Write Byte3 + " - " : Print Read3
+Write Byte4 + " - " : Print Read4
+Write Byte5 + " - " : Print Read5
+Write Byte6 + " - " : Print Read6
+Write Byte7 + " - " : Print Read7
+Write Byte8 + " - " : Print Chr$( Read8 )
+
+WaitKey()
+
+
+
+
-; Initialise some variables for the example
-Byte1% = 10 ; store 10
-Byte2% = 100 ; store 100
-Byte3% = 255 ; store 255 ( the maximum value that can be stored in a Byte)
-Byte4% = 256 ; try to store 256 this will end up as 0 ( i.e. 256 - 256 = 0 )
-Byte5% = 257 ; try to store 257 this will end up as 1 ( i.e. 257 - 256 = 1 )
-Byte6% = -1 ; try to store -1 this will end up as 255 ( i.e. 256 -1 = 255 )
-Byte7% = -2 ; try to store 256 this will end up as 254 ( i.e. 256 - 2 = 254 )
-Byte8% = Asc("A") ; Store the ASCII value for the Character "A" ( i.e. 65 )
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadBytes.htm b/_release/help/commands/2d_commands/ReadBytes.htm
index 29e5bb9..6cdd2b3 100644
--- a/_release/help/commands/2d_commands/ReadBytes.htm
+++ b/_release/help/commands/2d_commands/ReadBytes.htm
@@ -1,50 +1,85 @@
-Command: ReadBytes ReadBytes bank,file|stream,offset,count Definition:
Reads data from a file (or stream) into a memory bank.
Parameter Description:
bank = variable containing handle to valid bank
-file = file handle of previously opened file or stream
-offset = offset in bytes to write the value
-count = how many bytes to write from the offset
-
Command Description:
You can read the contents of a disk file (or stream) to a memory bank using this command.
+
+
+Blitz3D Docs
+
+
+
+
ReadBytes bank,file/stream,offset,count
+
Parameters
+
+
+
+bank = variable containing handle to valid bank
+file/stream = file handle of previously opened file or stream
+offset = offset in bytes to write the value
+count = how many bytes to write from the offset
+
+
+
+
Description
+
+
+
+You can read the contents of a disk file (or stream) to a memory bank using this command.
+
+Note: The file handle must be opened with OpenFile or OpenTCPStream and subsequently closed with CloseFile or CloseTCPStream after the reading operations are complete.
+
+Return how many bytes successfully read from a stream.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
-Note: The file handle must be opened with OpenFile or OpenTCPStream and subsequently closed with CloseFile or CloseTCPStream after the reading operations are complete.
-Return how many bytes successfully read from a stream.
-Streams can only be used in Blitz Basic v1.52 or greater.
Example:
; Read/WriteBytes Commands Example
+See also: WriteBytes.
+
+; Read/WriteBytes Commands Example
+
+; Create a 50 byte memory bank
+bnkTest=CreateBank(500)
+
+; Let's fill the bank with random data
+For t = 1 To 50
+
+ PokeByte bnkTest,t,Rnd(255)
+
+Next
+
+; Open a file to write to
+fileBank=WriteFile("test.bnk")
+; Write the bank to the file
+WriteBytes bnkTest,fileBank,0,50
+; Close it
+CloseFile fileBank
+
+; Free the bank
+FreeBank bnkTest
+
+; Make a new one
+bnkTest=CreateBank(500)
+
+; Open the file to read from
+fileBank=OpenFile("test.bnk")
+; Write the bank to the file
+ReadBytes bnkTest,fileBank,0,50
+; Close it
+CloseFile fileBank
+
+; Write back the results!
+For t = 1 To 50
+
+ Print PeekByte (bnkTest,t)
+
+Next
+
+
+
-; Create a 50 byte memory bank
-bnkTest=CreateBank(500)
+Index
-; Let's fill the bank with crap
-For t = 1 To 50
-PokeByte bnkTest,t,Rnd(255)
-PokeInt bnkTest,t+1,Rnd(10000)
-PokeShort bnkTest,t+2,Rnd(10000)
-PokeFloat bnkTest,t+3,Rnd(-.999,.999)
-Next
-
-; Open a file to write to
-fileBank=WriteFile("test.bnk")
-; Write the bank to the file
-WriteBytes bnkTest,fileBank,0,50
-; Close it
-CloseFile fileBank
-
-; Free the bank
-FreeBank bnkTest
-
-; Make a new one
-bnkTest=CreateBank(500)
-
-; Open the file to read from
-fileBank=OpenFile("test.bnk")
-; Write the bank to the file
-ReadBytes bnkTest,fileBank,0,50
-; Close it
-CloseFile fileBank
-
-; Write back the results!
-For t = 1 To 50
-Print PeekByte (bnkTest,t)
-Print PeekInt (bnkTest,t+1)
-Print PeekShort (bnkTest,t+2)
-Print PeekFloat (bnkTest,t+3)
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadDir.htm b/_release/help/commands/2d_commands/ReadDir.htm
index 6aa3050..92dc6f2 100644
--- a/_release/help/commands/2d_commands/ReadDir.htm
+++ b/_release/help/commands/2d_commands/ReadDir.htm
@@ -1,31 +1,64 @@
-Command: ReadDir ReadDir (directory) Definition:
Opens a folder/directory on a device for reading.
Parameter Description:
directory = full path and name of folder/directory to open
Command Description:
In file operations, you will often need to parse through a directory/folder and retrieve unknown filenames and other folders from it. This command opens a specified folder to begin these operations. The command returns a file handle which is used by the other commands to perform other services (like most file operators). You will use the NextFile$ to iterate through each entry (use FILETYPE to see if it is a file or folder). Remember, once completed, good programming practice dictates that you CloseDir the open folder. The example should help out alot.
+directory = full path and name of folder/directory to open
+
+
+
+
Description
+
+
+
+In file operations, you will often need to parse through a directory/folder and retrieve unknown filenames and other folders from it. This command opens a specified folder to begin these operations. The command returns a file handle which is used by the other commands to perform other services (like most file operators). You will use the NextFile$ to iterate through each entry (use FILETYPE to see if it is a file or folder). Remember, once completed, good programming practice dictates that you CloseDir the open folder. The example should help out alot.
+
+; ReadDir/NextFile$/CloseDir example
+
+; Define what folder to start with ...
+folder$="C:"
+
+; Open up the directory, and assign the handle to myDir
+myDir=ReadDir(folder$)
+
+; Let's loop forever until we run out of files/folders to list!
+Repeat
+; Assign the next entry in the folder to file$
+file$=NextFile$(myDir)
+
+; If there isn't another one, let's exit this loop
+If file$="" Then Exit
+
+; Use FileType to determine if it is a folder (value 2) or a file and print results
+If FileType(folder$+"\"+file$) = 2 Then
+Print "Folder:" + file$
+Else
+Print "File:" + file$
+End If
+Forever
+
+; Properly close the open folder
+CloseDir myDir
+
+; We're done!
+Print "Done listing files!"
+
+
+
-; Define what folder to start with ...
-folder$="C:\"
+Index
-; Open up the directory, and assign the handle to myDir
-myDir=ReadDir(folder$)
-
-; Let's loop forever until we run out of files/folders to list!
-Repeat
-; Assign the next entry in the folder to file$
-file$=NextFile$(myDir)
-
-; If there isn't another one, let's exit this loop
-If file$="" Then Exit
-
-; Use FileType to determine if it is a folder (value 2) or a file and print results
-If FileType(folder$+"\"+file$) = 2 Then
-Print "Folder:" + file$
-Else
-Print "File:" + file$
-End If
-Forever
-
-; Properly close the open folder
-CloseDir myDir
-
-; We're done!
-Print "Done listing files!"
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadFile.htm b/_release/help/commands/2d_commands/ReadFile.htm
index 509aba0..671a6de 100644
--- a/_release/help/commands/2d_commands/ReadFile.htm
+++ b/_release/help/commands/2d_commands/ReadFile.htm
@@ -1,53 +1,82 @@
-Command: ReadFile ReadFile (filename$) Definition:
Opens a file on disk for reading operations.
Parameter Description:
filename$ = any valid path and filename. The returned value is the filehandle which is an integer value.
Command Description:
This command opens the designated filename and prepares it to be read from. Use this to read back your own configuration file, save game data, etc. also useful for reading custom types from a files. The filehandle that is
-returned is an integer value that the operating system uses to identify which file is to be read from and must be passed to the functions such as ReadInt(). If the file could not be opened, for instance, if it does not exists, then the filehandle is Zero.
+
+
+Blitz3D Docs
+
+
+
+
ReadFile (filename$)
+
Parameters
+
+
+
+filename$ = any valid path and filename. The returned value is the filehandle which is an integer value.
+
+
+
+
Description
+
+
+
+This command opens the designated filename and prepares it to be read from. Use this to read back your own configuration file, save game data, etc. also useful for reading custom types from a files. The filehandle that is returned is an integer value that the operating system uses to identify which file is to be read from and must be passed to the functions such as ReadInt(). If the file could not be opened, for instance, if it does not exists, then the filehandle is Zero.
+
; Reading and writing custom types to files using ReadFile, WriteFile and
-CloseFile
+Index
-; Initialise some variables for the example
-Type HighScore
- Field Name$
- Field Score%
- Field Level%
-End Type
-
-Best.HighScore = New HighScore
-Best\Name = "Mark"
-Best\Score = 11657
-Best\Level = 34
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteString( fileout, Best\Name )
-WriteInt( fileout, Best\Score )
-WriteByte( fileout, Best\Level )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-; Lets read the Greatest score from the file
-Greatest.HighScore = New HighScore
-Greatest\Name$ = ReadString$( filein )
-Greatest\Score = ReadInt( filein )
-Greatest\Level = ReadByte( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "High score record read from - mydata.dat "
-Print
-Write "Name = "
-Print Greatest\Name
-Write "Score = "
-Print Greatest\Score
-Write "Level = "
-Print Greatest\Level
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadFloat.htm b/_release/help/commands/2d_commands/ReadFloat.htm
index 7ce3695..eff0034 100644
--- a/_release/help/commands/2d_commands/ReadFloat.htm
+++ b/_release/help/commands/2d_commands/ReadFloat.htm
@@ -1,46 +1,76 @@
-Command: ReadFloat ReadFloat (filehandle|stream) Definition:
Reads a single floating point value from an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+) The value returned is a floating point number.
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to read a single floating point number from the file. Note, each value written uses 4 bytes of space. Reading beyond the end of file does not result in an
-error, but each value read will be zero.
-
+
+
+Blitz3D Docs
+
+
+
+
ReadFloat (filehandle/stream)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+) The value returned is a floating point number.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to read a single floating point number from the file. Note, each value written uses 4 bytes of space. Reading beyond the end of file does not result in an error, but each value read will be zero.
+
Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadFloat and WriteFloat functions
+
+; Initialise some variables for the example
+Num1# = 10.5 ; store 10.5
+Num2# = 365.25 ; store 365.25
+Num3# = 32767.123 ; 32767.123 is the largest positive Short Integer Value in BlitzBasic )
+Num4# = -32768.123 ; -32768.123 the largest negative Short Integer Value in BlitzBasic )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteFloat( fileout, Num1 )
+WriteFloat( fileout, Num2 )
+WriteFloat( fileout, Num3 )
+WriteFloat( fileout, Num4 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1# = ReadFloat( filein )
+Read2# = ReadFloat( filein )
+Read3# = ReadFloat( filein )
+Read4# = ReadFloat( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Floating Point Data Read From File - mydata.dat "
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
; Reading and writing a file using ReadFloat and WriteFloat functions
-
-; Initialise some variables for the example
-Num1# = 10.5 ; store 10.5
-Num2# = 365.25 ; store 365.25
-Num3# = 32767.123 ; 32767.123 is the largest positive Short Integer Value in BlitzBasic )
-Num4# = -32768.123 ; -32768.123 the largest negative Short Integer Value in BlitzBasic )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteFloat( fileout, Num1 )
-WriteFloat( fileout, Num2 )
-WriteFloat( fileout, Num3 )
-WriteFloat( fileout, Num4 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1# = ReadFloat( filein )
-Read2# = ReadFloat( filein )
-Read3# = ReadFloat( filein )
-Read4# = ReadFloat( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Floating Point Data Read From File - mydata.dat "
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadInt.htm b/_release/help/commands/2d_commands/ReadInt.htm
index b347057..5575f8c 100644
--- a/_release/help/commands/2d_commands/ReadInt.htm
+++ b/_release/help/commands/2d_commands/ReadInt.htm
@@ -1,45 +1,77 @@
-Command: ReadInt ReadInt (filehandle|stream) Definition:
Reads a single 32bit integer value from an open file (or stream) and returns it as an integer value.
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
-The value returned is an integer in the range -2147483648 to 2147483647
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to read a single integer value from the file. Note, each value written uses 4 bytes of space and is written least significant byte first. Reading beyond the end of file does not result in an error, but each value read will be zero.
+
+
+Blitz3D Docs
+
+
+
+
ReadInt (filehandle/stream)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
+The value returned is an integer in the range -2147483648 to 2147483647
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to read a single integer value from the file. Note, each value written uses 4 bytes of space and is written least significant byte first. Reading beyond the end of file does not result in an error, but each value read will be zero.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadInt and WriteInt functions
+
+; Initialise some variables for the example
+Int1% = 10 ; store 10
+Int2% = 365 ; store 365
+Int3% = 2147483647 ; store 2147483647 the largest positive Integer Value in BlitzBasic )
+Int4% = - 2147483648 ; store -2147483648 the largest negative Integer Value in BlitzBasic )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteInt( fileout, Int1 )
+WriteInt( fileout, Int2 )
+WriteInt( fileout, Int3 )
+WriteInt( fileout, Int4 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1 = ReadInt( filein )
+Read2 = ReadInt( filein )
+Read3 = ReadInt( filein )
+Read4 = ReadInt( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Integer Data Read From File - mydata.dat "
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Streams can only be used in Blitz Basic v1.52 or greater.
+Index
; Reading and writing a file using ReadInt and WriteInt functions
-
-; Initialise some variables for the example
-Int1% = 10 ; store 10
-Int2% = 365 ; store 365
-Int3% = 2147483647 ; store 2147483647 the largest positive Integer Value in BlitzBasic )
-Int4% = - 2147483648 ; store -2147483648 the largest negative Integer Value in BlitzBasic )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteInt( fileout, Int1 )
-WriteInt( fileout, Int2 )
-WriteInt( fileout, Int3 )
-WriteInt( fileout, Int4 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1 = ReadInt( filein )
-Read2 = ReadInt( filein )
-Read3 = ReadInt( filein )
-Read4 = ReadInt( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Integer Data Read From File - mydata.dat "
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadLine.htm b/_release/help/commands/2d_commands/ReadLine.htm
index 14be8fd..8604285 100644
--- a/_release/help/commands/2d_commands/ReadLine.htm
+++ b/_release/help/commands/2d_commands/ReadLine.htm
@@ -1,50 +1,83 @@
-Command: ReadLine$ ReadLine$ (filehandle|stream) Definition:
Reads a single line of text from an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+). The value returned is a text string.
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to read a whole line of text from a text file or stream. Each line of text is returned as a string variable. This function can be used to read plain text files.
+
+
+Blitz3D Docs
+
+
+
+
ReadLine$ (filehandle/stream)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+). The value returned is a text string.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to read a whole line of text from a text file or stream. Each line of text is returned as a string variable. This function can be used to read plain text files.
+
+
+Characters are read from the input file until an "end-of-line" mark is found. An "end-of-line" can be a single carriage return (0Dh) or a single linefeed (0Ah) or carriage return followed by a linefeed (0Dh, 0Ah). Reading beyond the end of file does not result in an error, but each value read will be a zero length string.
+
+
+ReadLine$ returns all chars except chr$(13)/chr$(10).
+
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadLine$ and WriteLine functions
+
+; Initialise some variables for the example
+String1$ = "Line 1 is short"
+String2$ = "Line 2 is a longer line but they can be much longer"
+String3$ = "Line 3 is made up "
+String4$ = "of two parts joined together."
+
+; Open a file to write to
+fileout = WriteFile("mydata.txt")
+
+; Write the information to the file
+WriteLine( fileout, String1 )
+WriteLine( fileout, String2 )
+WriteLine( fileout, String3 + String4)
+WriteLine( fileout, "Just to show you don't have to use variables" )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.txt")
+
+Read1$ = ReadLine$( filein )
+Read2$ = ReadLine$( filein )
+Read3$ = ReadLine$( filein )
+Read4$ = ReadLine$( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Lines of text read from file - mydata.txt "
+Print
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
-Characters are read from the input file until an "end-of-line" mark is found. An "end-of-line" can be a single carriage return (0Dh) or a single linefeed (0Ah) or carriage return followed by a linefeed (0Dh, 0Ah). Reading beyond the end of file does not result in an error, but each value
-read will be a zero length string.
+Index
; Reading and writing a file using ReadLine$ and WriteLine functions
-
-; Initialise some variables for the example
-String1$ = "Line 1 is short"
-String2$ = "Line 2 is a longer line but they can be much longer"
-String3$ = "Line 3 is made up "
-String4$ = "of two parts joined together."
-
-; Open a file to write to
-fileout = WriteFile("mydata.txt")
-
-; Write the information to the file
-WriteLine( fileout, String1 )
-WriteLine( fileout, String2 )
-WriteLine( fileout, String3 + String4)
-WriteLine( fileout, "Just to show you don't have to use variables" )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.txt")
-
-Read1$ = ReadLine( filein )
-Read2$ = ReadLine$( filein )
-Read3$ = ReadLine$( filein )
-Read4$ = ReadLine$( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Lines of text read from file - mydata.txt "
-Print
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadPixel.htm b/_release/help/commands/2d_commands/ReadPixel.htm
index 569773e..11c51f0 100644
--- a/_release/help/commands/2d_commands/ReadPixel.htm
+++ b/_release/help/commands/2d_commands/ReadPixel.htm
@@ -1,52 +1,83 @@
-Command: ReadPixel ReadPixel (x,y,[buffer]) Definition:
Quickly reads the value of a single pixel on the screen.
Parameter Description:
x = x location of the pixel to read
-y = y location of the pixel to read
-buffer = any valid screen/image buffer (optional)
Command Description:
This command will allow you fast access to a specific pixel in the buffer selected. While this command reads the pixel quickly (and it can be written back quickly with WritePixel, it is still not fast enough for real-time screen effects.
+
+
+Blitz3D Docs
+
+
+
+
ReadPixel (x,y,[buffer])
+
Parameters
+
+
+
+x - x coordinate of pixel
+y - y coordinate of pixel
+buffer (optional) - name of buffer to read colour value from, e.g. BackBuffer() (defaults to current graphics buffer)
+
+
+
+
Description
+
+
+
+Reads a color value from either the current buffer or the specified buffer.
+
+The returned colour value is in the form of an integer that contains the alpha, red, green and blue values of the pixel.
+
+You can use this command on a locked buffer for a slight speed-up. See LockBuffer.
+
+Warning: this is a low level command with no error checking for out of range parameters, use with care.
-You are not required to lock the buffer with LockBuffer and subsequently unlock the buffer with UnlockBuffer. However, the operations will be a bit faster if you do.
-V1.52 and above: It has been necessary to make ReadPixel and ReadPixelFast "alpha-aware".
+See also: GetColor, ReadPixelFast.
+
+; ReadPixel/WritePixel Example
+; ----------------------------
+
+Graphics 640,480,16
+
+Print "Press a key to read color values (this may take a few seconds)"
+WaitKey()
+
+; Load and draw an image on to the screen - can be anything
+pic=LoadImage("media/blitz_pic.bmp")
+DrawImage pic,0,0
+
+; Initialise an array big enough to fit all the color information of the screen
+Dim pix(GraphicsWidth(),GraphicsHeight())
+
+; Use ReadPixel to get all the color information of the screen
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+pix(x,y)=ReadPixel(x,y)
+Next
+Next
+
+Cls
+Locate 0,0
+Print "Press a key to write pixels (this may takes a few seconds)"
+Print "Once this has finished, you can then press a key to end the program"
+
+WaitKey()
+
+; Use WritePixel to redraw the screen using the color information we got earlier
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+WritePixel x,y,pix(x,GraphicsHeight()-y) ; get y array value in backwards order, to flip screen
+Next
+Next
+
+WaitKey()
+
+
+
-This means that the high 8 bits of the color returned ReadPixel/ReadPixelFast now contain valid alpha information.
+Index
-However, in the case of Blitz2D apps, there is no alpha information in images!
-
-Mark decided that in the abscence of any alpha information, a pixel is assumed to have 'full' alpha.
-
-Therefore, values returned by ReadPixel/ReadPixelFast will now (usually) have their high 8 bits sets. The exception will be when reading pixels from Blitz3D textures created with an alpha channel.
-
-To get the old behaviour of v1.50 (and below) of ReadPixel/ReadPixelFast, use the following:
-
-rgb=ReadPixel( x,y ) And $FFFFFF
-
-This will 'mask out' the 8 high bits of alpha and return just the red, green and blue components of the pixel.
Example:
; High Speed Graphics Commands
-
-Graphics 640,480,16
-
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
-
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-LockBuffer FrontBuffer()
-For x = 1 To 640
-For y = 1 To 240
-WritePixelFast x,y+241,ReadPixelFast(x,y)
-Next
-Next
-UnlockBuffer FrontBuffer()
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-WritePixel x+320,y,ReadPixel(x,y)
-Next
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadPixelFast.htm b/_release/help/commands/2d_commands/ReadPixelFast.htm
index ca00f4f..53d3384 100644
--- a/_release/help/commands/2d_commands/ReadPixelFast.htm
+++ b/_release/help/commands/2d_commands/ReadPixelFast.htm
@@ -1,54 +1,101 @@
-Command: ReadPixelFast ReadPixelFast (x,y,[buffer]) Definition:
High speed pixel reading from an image buffer.
Parameter Description:
x = x location of the pixel to read
-y = y location of the pixel to read
-buffer = any valid screen/image buffer (optional)
Command Description:
This command will allow you fast access to a specific pixel in the buffer selected. While this command reads the pixel quickly (and it can be written back quickly with WritePixelFast, it is still not fast enough for real-time screen effects.
+
+
+Blitz3D Docs
+
+
+
+
ReadPixelFast (x,y,[buffer])
+
Parameters
+
+
+
+x - y-coordinate of pixel
+y - y-coordinate of pixel
+buffer (optional) - name of buffer to read colour value from, e.g. BackBuffer()
+
+
+
+
Description
+
+
+
+Reads a color value from either the current buffer or the specified buffer, and returns it.
+
+The returned colour value is in the form of an integer than contains the alpha, red, green and blue values of the pixel.
+
+IMPORTANT:
+
+You *must* use this command on a locked buffer, otherwise the command will fail. See LockBuffer.
+
+Also, you must make sure that the coordinates that you are reading from are valid, otherwise you will end up reading garbage values.
+
+WARNING:
+
+By not following the above advice, you may cause your computer to crash.
+
+See also: GetColor, ReadPixel.
+
+; ReadPixelFast/WritePixeFast Example
+; -----------------------------------
+
+Graphics 640,480,16
+
+Print "Press a key to read color values"
+WaitKey()
+
+; Load and draw an image on to the screen - can be anything
+pic=LoadImage("media/blitz_pic.bmp")
+DrawImage pic,0,0
+
+; Initialise an array big enough to fit all the color information of the screen
+Dim pix(GraphicsWidth(),GraphicsHeight())
+
+; Lock buffer before using ReadPixelFast
+LockBuffer
+
+; Use ReadPixel to get all the color information of the screen
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+pix(x,y)=ReadPixelFast(x,y)
+Next
+Next
+
+; Lock buffer after using ReadPixelFast
+UnlockBuffer
+
+Cls
+Locate 0,0
+Print "Press a key to write pixels"
+Print "Once this has finished, you can then press a key to end the program"
+
+WaitKey()
+
+; Lock buffer before using WritePixelFast
+LockBuffer
+
+; Use WritePixel to redraw the screen using the color information we got earlier
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+WritePixelFast x,y,pix(x,GraphicsHeight()-y) ; get y array value in backwards order, to flip screen
+Next
+Next
+
+; Unlock buffer after using WritePixelFast
+UnlockBuffer
+
+WaitKey()
+
+
+
+
-You are required to lock the buffer with LockBuffer and subsequently unlock the buffer with UnlockBuffer when the operations are complete before any other graphics commands can be used.
+Index
-WARNING: You are playing with power. There is nothing keeping you from writing directly to memory off the screen and TRASHING it. You can crash Blitz using this command.
-
-V1.52 and above: It has been necessary to make ReadPixel and ReadPixelFast "alpha-aware".
-
-This means that the high 8 bits of the color returned ReadPixel/ReadPixelFast now contain valid alpha information.
-
-However, in the case of Blitz2D apps, there is no alpha information in images!
-
-Mark decided that in the abscence of any alpha information, a pixel is assumed to have 'full' alpha.
-
-Therefore, values returned by ReadPixel/ReadPixelFast will now (usually) have their high 8 bits sets. The exception will be when reading pixels from Blitz3D textures created with an alpha channel.
-
-To get the old behaviour of v1.50 (and below) of ReadPixel/ReadPixelFast, use the following:
-
-rgb=ReadPixel( x,y ) And $FFFFFF
-
-This will 'mask out' the 8 high bits of alpha and return just the red, green and blue components of the pixel.
Example:
; High Speed Graphics Commands
-
-Graphics 640,480,16
-
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
-
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-LockBuffer FrontBuffer()
-For x = 1 To 640
-For y = 1 To 240
-WritePixelFast x,y+241,ReadPixelFast(x,y)
-Next
-Next
-UnlockBuffer FrontBuffer()
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-WritePixel x+320,y,ReadPixel(x,y)
-Next
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadShort.htm b/_release/help/commands/2d_commands/ReadShort.htm
index d3faf25..3e484b6 100644
--- a/_release/help/commands/2d_commands/ReadShort.htm
+++ b/_release/help/commands/2d_commands/ReadShort.htm
@@ -1,45 +1,77 @@
-Command: ReadShort ReadShort (filehandle|stream) Definition:
Reads a single short integer value (16 bits) from an open file (or stream) and returns it as an integer value.
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
-The value returned is an integer in the range 0-65535.
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to read a single short integer (16bit) value from the file. Note, each value written uses 2 bytes of disk space and is written least significant byte first. Reading beyond the end of file does not result in an error, but each value read will be zero.
+
+
+Blitz3D Docs
+
+
+
+
ReadShort (filehandle/stream)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
+The value returned is an integer in the range 0-65535.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to read a single short integer (16bit) value from the file. Note, each value written uses 2 bytes of disk space and is written least significant byte first. Reading beyond the end of file does not result in an error, but each value read will be zero.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadShort and WriteShort functions
+
+; Initialise some variables for the example
+Int1% = 10 ; store 10
+Int2% = 365 ; store 365
+Int3% = 32767 ; 32767 is the largest positive Short Integer Value in BlitzBasic )
+Int4% = -32768 ; -32768 the largest negative Short Integer Value in BlitzBasic )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteShort( fileout, Int1 )
+WriteShort( fileout, Int2 )
+WriteShort( fileout, Int3 )
+WriteShort( fileout, Int4 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1 = ReadShort( filein )
+Read2 = ReadShort( filein )
+Read3 = ReadShort( filein )
+Read4 = ReadShort( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Short Integer Data Read From File - mydata.dat "
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Streams can only be used in Blitz Basic v1.52 or greater.
+Index
; Reading and writing a file using ReadShort and WriteShort functions
-
-; Initialise some variables for the example
-Int1% = 10 ; store 10
-Int2% = 365 ; store 365
-Int3% = 32767 ; 32767 is the largest positive Short Integer Value in BlitzBasic )
-Int4% = -32768 ; -32768 the largest negative Short Integer Value in BlitzBasic )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteShort( fileout, Int1 )
-WriteShort( fileout, Int2 )
-WriteShort( fileout, Int3 )
-WriteShort( fileout, Int4 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1 = ReadShort( filein )
-Read2 = ReadShort( filein )
-Read3 = ReadShort( filein )
-Read4 = ReadShort( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Short Integer Data Read From File - mydata.dat "
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ReadString.htm b/_release/help/commands/2d_commands/ReadString.htm
index 9547c8e..ecd3e30 100644
--- a/_release/help/commands/2d_commands/ReadString.htm
+++ b/_release/help/commands/2d_commands/ReadString.htm
@@ -1,50 +1,82 @@
-Command: ReadString$ ReadString$ (filehandle|stream) Definition:
Reads a single string variable from an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
-The value returned is a text string.
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to read a string variable from the file.
+
+
+Blitz3D Docs
+
+
+
+
ReadString$ (filehandle/stream)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+) The value returned is a text string.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to read a string variable from the file.
+
+Each string is stored in the file as a 4 byte (32bit) integer followed by the characters that form the string. The integer contains the number of characters in the string, i.e. its length. Note, that Carriage Return, Line Feed and Null characters are NOT use to indicate the end of the string. A file of strings cannot be read like a text file, since it contains string variables and not text. A null string, i.e. a string of zero length ("") is stored as 4 bytes, an integer count with a value = zero, followed by no Characters. Note strings are not limited to 255 characters as in some languages. Reading beyond the end of file does not result in an error, but each value read will be a zero length string.
+
+This command should only be used when reading from a binary file or stream. Text files should be interrogated using ReadLine.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
-Each string is stored in the file as a 4 byte (32bit) integer followed by the characters that form the string. The integer contains the number of characters in the string, i.e. its length. Note, that Carriage Return, Line
-Feed and Null characters are NOT use to indicate the end of the string. A file of strings cannot be read like a text file, since it contains string variables and not text. A null string, i.e. a string of zero length ("") is
-stored as 4 bytes, an integer count with a value = zero, followed by no Characters. Note strings are not limited to 255 characters as in some languages. Reading beyond the end of file does not result in an error, but each value read will be a zero length string.
+; Reading and writing a file using ReadString$ and WriteString functions
+
+; Initialise some variables for the example
+String1$ = "A short string"
+String2$ = "A longer string since these are variables lengths"
+String3$ = "This is string3 "
+String4$ = "joined to string4"
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteString( fileout, String1 )
+WriteString( fileout, String2 )
+WriteString( fileout, String3 + String4)
+WriteString( fileout, "Just to show you don't have to use variables" )
+
+; Close the file
+CloseFile( fileout )
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1$ = ReadString$( filein )
+Read2$ = ReadString$( filein )
+Read3$ = ReadString$( filein )
+Read4$ = ReadString$( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "String Variables Read From File - mydata.dat "
+Print
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
; Reading and writing a file using ReadString$ and WriteString functions
+Index
-; Initialise some variables for the example
-String1$ = "A short string"
-String2$ = "A longer string since these are variables lengths"
-String3$ = "This is string3 "
-String4$ = "joined to string4"
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteString( fileout, String1 )
-WriteString( fileout, String2 )
-WriteString( fileout, String3 + String4)
-WriteString( fileout, "Just to show you don't have to use variables" )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1$ = ReadString$( filein )
-Read2$ = ReadString$( filein )
-Read3$ = ReadString$( filein )
-Read4$ = ReadString$( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "String Variables Read From File - mydata.dat "
-Print
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Rect.htm b/_release/help/commands/2d_commands/Rect.htm
index e74e6fa..7acd0c2 100644
--- a/_release/help/commands/2d_commands/Rect.htm
+++ b/_release/help/commands/2d_commands/Rect.htm
@@ -1,25 +1,59 @@
-Command: Rect Rect x, y, width, height, solid Definition:
Draw a rectangle on the screen
Parameter Description:
x = x coordinate to begin drawing the rectangle
-y = y coordinate to begin drawing the rectangle
-width = how wide to make the rectangle in pixels
-height = how tall to make the rectangle in pixels
-solid = 0 or False for unfilled and 1 or True for filled
Command Description:
This command will draw a rectangle in the current drawing Color starting at the location specified. The last parameter determines if the rectangle is filled or just a 'box'.
+x = x coordinate to begin drawing the rectangle
+y = y coordinate to begin drawing the rectangle
+width = how wide to make the rectangle in pixels
+height = how tall to make the rectangle in pixels
+solid = 0 or False for unfilled and 1 or True for filled
+
+
+
+
Description
+
+
+
+This command will draw a rectangle in the current drawing Color starting at the location specified. The last parameter determines if the rectangle is filled or just a 'box'.
+
+; Flip/Backbuffer()/Rect Example
+
+; Set Graphics Mode
+Graphics 640,480
+
+; Go double buffering
+SetBuffer BackBuffer()
+
+; Setup initial locations for the box
+box_x = -20 ; negative so it will start OFF screen
+box_y = 100
+
+While Not KeyHit(1)
+Cls ; Always clear screen first
+Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
+Flip ; Flip it into view
+box_x = box_x + 1 ; Move the box over one pixel
+If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
+Wend
+
+
-; Go double buffering
-SetBuffer BackBuffer()
-
-; Setup initial locations for the box
-box_x = -20 ; negative so it will start OFF screen
-box_y = 100
-
-While Not KeyHit(1)
-Cls ; Always clear screen first
-Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
-Flip ; Flip it into view
-box_x = box_x + 1 ; Move the box over one pixel
-If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/RectsOverlap.htm b/_release/help/commands/2d_commands/RectsOverlap.htm
index 4de82a7..c36b443 100644
--- a/_release/help/commands/2d_commands/RectsOverlap.htm
+++ b/_release/help/commands/2d_commands/RectsOverlap.htm
@@ -1,61 +1,96 @@
-Command: RectsOverlap RectsOverlap (rect1 X,rect1 Y,rect1 Width,rect1 Height,rect2 X,rect2 Y,rect2 Width,rect2 Height) Definition:
Tests to see if two rectangular areas are overlapping.
Parameter Description:
rect1 X = rectangle 1 x location
-rect1 Y = rectangle 1 y location
-rect1 Width = rectangle 1 width
-rect1 Height = rectangle 1 height
-rect2 X = rectangle 2 x location
-rect2 Y = rectangle 2 y location
-rect2 Width = rectangle 2 width
-rect2 Height = rectangle 2 height
Command Description:
This command will take two rectangular locations on the screen and see if they overlap. You will need to know the x, y, width, and height of both regions to test.
+
+
+Blitz3D Docs
+
+
+
+
+rect1 X = rectangle 1 x location
+rect1 Y = rectangle 1 y location
+rect1 Width = rectangle 1 width
+rect1 Height = rectangle 1 height
+rect2 X = rectangle 2 x location
+rect2 Y = rectangle 2 y location
+rect2 Width = rectangle 2 width
+rect2 Height = rectangle 2 height
+
+
+
+
Description
+
+
+
+This command will take two rectangular locations on the screen and see if they overlap. You will need to know the x, y, width, and height of both regions to test.
+
+I'm still trying to find a real good logical use for this command with all the other collision commands available to you like ImagesOverlap, ImagesCollide, ImageRectOverlap, and ImageRectCollide. My guess is that this is the absolute fastest possible collision method available and useful to those wishing to write their own collision routines.
+
+Unlike the other collision commands, there is no image to detect a collision with - simply one rectangular location overlapping another. You could probably use this command instead of the ImageRectOverlap command, as they are really basically doing the same thing (and I betcha this is faster).
+
+This would be useful for very easy-going 'Monkey Island' games to check the position of your pointer against a screen location (or 'hot spot') when pixel perfect accuracy (heck, image graphics in general) are not really needed.
+
+; RectsOverlap Example
+; Flashing graphics warning! Gets hypnotic ...
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Double buffering, and randomize the randomizer
+SetBuffer BackBuffer()
+SeedRnd MilliSecs()
+
+; Repeat the loop until ESC pressed
+While Not KeyHit(1)
+
+; Generate a random rectangle
+rect1X=Rnd(50,610)
+rect1Y=Rnd(50,430)
+rect1W=20
+rect1H=20
+
+; And another
+rect2X=Rnd(50,610)
+rect2Y=Rnd(50,430)
+rect2W=20
+rect2H=20
+; Clear the screen standard double buffering
+Cls
+; Draw our rectangle2 in random colors
+Color Rnd(255),Rnd(255),Rnd(255)
+Rect rect1X,rect1Y,rect1W,rect1H,0
+Color Rnd(255),Rnd(255),Rnd(255)
+Rect rect2X,rect2Y,rect2W,rect2H,0
+
+; Did they collide? If so, print a message and exit the loop!
+If RectsOverlap (rect1X,rect1Y,rect1W,rect1H,rect2X,rect2Y,rect2W,rect2H) Then
+Text 0,0, "Our boxes finally collided! Press a mouse button..."
+; We do a flip here to ensure the text message gets seen too!
+Flip
+Exit ; exit the While/Wend loop
+End If
+; Flip the rects into view, wait 1/10th of a sec, repeat
+Flip
+Delay 100
+Wend
+; Wait for a mouse click
+WaitMouse()
+; End our graphics mode
+EndGraphics
+
+
+
+
-I'm still trying to find a real good logical use for this command with all the other collision commands available to you like ImagesOverlap, ImagesCollide, ImageRectOverlap, and ImageRectCollide. My guess is that this is the absolute fastest possible collision method available and useful to those wishing to write their own collision routines.
+Index
-Unlike the other collision commands, there is no image to detect a collision with - simply one rectangular location overlapping another. You could probably use this command instead of the ImageRectOverlap command, as they are really basically doing the same thing (and I betcha this is faster).
-
-This would be useful for very easy-going 'Monkey Island' games to check the position of your pointer against a screen location (or 'hot spot') when pixel perfect accuracy (heck, image graphics in general) are not really needed.
Example:
; RectsOverlap Example
-; Flashing graphics warning! Gets hypnotic ...
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Double buffering, and randomize the randomizer
-SetBuffer BackBuffer()
-SeedRnd MilliSecs()
-
-; Repeat the loop until ESC pressed
-While Not KeyHit(1)
-
-; Generate a random rectangle
-rect1X=Rnd(50,610)
-rect1Y=Rnd(50,430)
-rect1W=20
-rect1H=20
-
-; And another
-rect2X=Rnd(50,610)
-rect2Y=Rnd(50,430)
-rect2W=20
-rect2H=20
-; Clear the screen standard double buffering
-Cls
-; Draw our rectangle2 in random colors
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect rect1X,rect1Y,rect1W,rect1H,0
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect rect2X,rect2Y,rect2W,rect2H,0
-
-; Did they collide? If so, print a message and exit the loop!
-If RectsOverlap (rect1X,rect1Y,rect1W,rect1H,rect2X,rect2Y,rect2W,rect2H) Then
-Text 0,0, "Our boxes finally collided! Press a mouse button..."
-; We do a flip here to ensure the text message gets seen too!
-Flip
-Exit ; exit the While/Wend loop
-End If
-; Flip the rects into view, wait 1/10th of a sec, repeat
-Flip
-Delay 100
-Wend
-; Wait for a mouse click
-WaitMouse()
-; End our graphics mode
-EndGraphics
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/RecvNetMsg.htm b/_release/help/commands/2d_commands/RecvNetMsg.htm
index d923cc1..db8ce9b 100644
--- a/_release/help/commands/2d_commands/RecvNetMsg.htm
+++ b/_release/help/commands/2d_commands/RecvNetMsg.htm
@@ -1,45 +1,80 @@
-Command: RecvNetMsg() RecvNetMsg() Definition:
Boolean value denotes whether a network message has arrived.
Parameter Description:
None.
Command Description:
First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+
+Blitz3D Docs
+
+
+
+
RecvNetMsg()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+This returns a TRUE value if a message was received, FALSE if none has been received. This will typically go inside a function that is constantly being checked for message and decode and handle them. You will use NetMsgType, NetMsgFrom, NetMsgTo, and NetMsgData$ to get the important information from the message and act on it.
+
+The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
+
+; RecvNetMsg() example
+; --------------------
+; Run this program on the REMOTE computer to 'watch'
+; the activity of the SendNetMsg example. Run that
+; example on local machine.
+;
+; This program will tell you when a player involved in
+; the game hits a wall ...
+
+; We'll use this instead of JoinHostGame - make it easier
+StartNetGame()
+
+; Create a player - a player must be created to
+; receive mesages!
+playerID=CreateNetPlayer("Shane")
+
+; Loop and get status
+While Not KeyHit(1)
+
+; Check to see if we've received a message
+If RecvNetMsg() Then
+
+; if we did, let's figure out what type it is
+; we know it will be a user message, though
+msgType=NetMsgType()
+
+; 1-99 means a user message
+If msgType>0 And msgType<100 Then
+
+; Let's see who the message was from
+msgFrom=NetMsgFrom()
+
+; Let's get the message!
+msgData$=NetMsgData$()
+
+; Print the message
+Print msgData$
+End If
+End If
+Wend
+
+
+
+
-This returns a TRUE value if a message was received, FALSE if none has been received. This will typically go inside a function that is constantly being checked for message and decode and handle them. You will use NetMsgType, NetMsgFrom, NetMsgTo, and NetMsgData$ to get the important information from the message and act on it.
+Index
-The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
Example:
; RecvNetMsg() example
-; --------------------
-; Run this program on the REMOTE computer to 'watch'
-; the activity of the SendNetMsg example. Run that
-; example on local machine.
-;
-; This program will tell you when a player involved in
-; the game hits a wall ...
-
-; We'll use this instead of JoinHostGame - make it easier
-StartNetGame()
-
-; Create a player - a player must be created to
-; receive mesages!
-playerID=CreateNetPlayer("Shane")
-
-; Loop and get status
-While Not KeyHit(1)
-
-; Check to see if we've received a message
-If RecvNetMsg() Then
-
-; if we did, let's figure out what type it is
-; we know it will be a user message, though
-msgType=NetMsgType()
-
- ; 1-99 means a user message
- If msgType>0 And msgType<100 Then
-
- ; Let's see who the message was from
- msgFrom=NetMsgFrom()
-
- ; Let's get the message!
- msgData$=NetMsgData$()
-
- ; Print the message
- Print msgData$
- End If
-End If
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Repeat.htm b/_release/help/commands/2d_commands/Repeat.htm
index c0e4ddf..dc996cf 100644
--- a/_release/help/commands/2d_commands/Repeat.htm
+++ b/_release/help/commands/2d_commands/Repeat.htm
@@ -1,7 +1,43 @@
-Command: Repeat Repeat Definition:
First command of the REPEAT ... UNTIL loop.
Parameter Description:
None
Command Description:
The REPEAT ... UNTIL loop allows you to perform a series of commands until a specific condition has been met. This lets the conditional appear after the commands have been executed before checking, not before like the WHILE ... WEND loop does. In general, use REPEAT ... UNTIL if you know you will have the commands enclosed between them execute at least once.
Example:
; Repeat until user hits ESC key
+
+
+Blitz3D Docs
+
+
+
+
Repeat
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+The REPEAT ... UNTIL loop allows you to perform a series of commands until a specific condition has been met. This lets the conditional appear after the commands have been executed before checking, not before like the WHILE ... WEND loop does. In general, use REPEAT ... UNTIL if you know you will have the commands enclosed between them execute at least once.
-Repeat
-print "Press ESC to quit this!"
-Until KeyHit(1)
-
+; Repeat until user hits ESC key
+
+Repeat
+print "Press ESC to quit this!"
+Until KeyHit(1)
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Replace.htm b/_release/help/commands/2d_commands/Replace.htm
index 6224dd5..f2aba85 100644
--- a/_release/help/commands/2d_commands/Replace.htm
+++ b/_release/help/commands/2d_commands/Replace.htm
@@ -1,7 +1,41 @@
-Command: Replace$ Replace$ (string$, find$, replace$) Definition:
Replace occurances of one string with another within a string.
Parameter Description:
string$ = any valid string variable
-find$ = any valid string
-replace$ = any valid string
Command Description:
This command will allow you to replace characters within a string with another. Use this to strip or convert letters out of your strings (like removing spaces or turning them into underscores). Pretty straight forward.
Example:
name$="Bill Wallace"
-Print "Your name before replacing: " + name$
-Print "Your name with L changed to B: " + Replace$(name$,"l","b")
-
+string$ = any valid string variable
+find$ = any valid string
+replace$ = any valid string
+
+
+
+
Description
+
+
+
+This command will allow you to replace characters within a string with another. Use this to strip or convert letters out of your strings (like removing spaces or turning them into underscores). Pretty straight forward.
+
+name$="Bill Wallace"
+Print "Your name before replacing: " + name$
+Print "Your name with L changed to B: " + Replace$(name$,"l","b")
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ResizeBank.htm b/_release/help/commands/2d_commands/ResizeBank.htm
index 0252e9d..ab1f180 100644
--- a/_release/help/commands/2d_commands/ResizeBank.htm
+++ b/_release/help/commands/2d_commands/ResizeBank.htm
@@ -1,21 +1,55 @@
-Command: ResizeBank ResizeBank bankhandle,new_size Definition:
Resizes a bank.
Parameter Description:
bankhandle = handle assigned to bank when created
-new_size = new size of bank in bytes
Command Description:
Resizes a previously created memory bank. Existing bank data is unmodified, but may be moved in memory. Also see CreateBank, CopyBank, and BankSize.
+bankhandle = handle assigned to bank when created
+new_size = new size of bank in bytes
+
+
+
+
Description
+
+
+
+Resizes a previously created memory bank. Existing bank data is unmodified, but may be moved in memory. Also see CreateBank, CopyBank, and BankSize.
+
+; BankSize, ResizeBank, CopyBank Example
+
+; create a bank
+bnkTest=CreateBank(5000)
+
+; Fill it with rand Integers
+For t = 0 To 4999
+PokeByte bnkTest,t,Rand(9)
+Next
+
+; Resize the bank
+ResizeBank bnkTest,10000
+
+; Copy the first half of the bank to the second half
+CopyBank bnkTest,0,bnkTest,5000,5000
+
+; Print final banksize
+Print BankSize(bnkTest)
+
+
-; Fill it with rand Integers
-For t = 0 To 4999
-PokeByte bnkTest,t,Rand(9)
-Next
-
-; Resize the bank
-ResizeBank bnkTest,10000
-
-; Copy the first half of the bank to the second half
-CopyBank bnkTest,0,bnkTest,5000,5000
-
-; Print final banksize
-Print BankSize(bnkTest)
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ResizeImage.htm b/_release/help/commands/2d_commands/ResizeImage.htm
index fd5bd94..a9a8236 100644
--- a/_release/help/commands/2d_commands/ResizeImage.htm
+++ b/_release/help/commands/2d_commands/ResizeImage.htm
@@ -1,24 +1,59 @@
-Command: ResizeImage ResizeImage image,width#,height# Definition:
Resizes an image to a new size using pixel values.
Parameter Description:
image = file handle for previously loaded image
-width# = new width in pixels
-height# = new height in pixels
Command Description:
Similar to ScaleImage, but uses pixel values instead of percentages. Use this command to resize an image previously loaded with LoadImage or LoadAnimImage.
+
+
+Blitz3D Docs
+
+
+
+
ResizeImage image,width#,height#
+
Parameters
+
+
+
+image = file handle for previously loaded image
+width# = new width in pixels
+height# = new height in pixels
+
+
+
+
Description
+
+
+
+Similar to ScaleImage, but uses pixel values instead of percentages. Use this command to resize an image previously loaded with LoadImage or LoadAnimImage.
+
+This is NOT intended for REAL TIME scaling of images! Precalculate your images before running your program, or you will likely see massively slow renderings of graphics.
+
+; ResizeImage example
+
+; Set Graphics Mode
+Graphics 800,600,16
+
+; Randomize the random seed
+SeedRnd MilliSecs()
+
+; Load an image to tile (your location might vary)
+gfxBall=LoadImage("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Size it randomly from 300 to -300 both x and y
+ResizeImage gfxBall,Rnd(-300,300),Rnd(-300,300)
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+DrawImage gfxball,Rnd(800),Rnd(600)
+VWait
+Wend
+
+
+
+
-This is NOT intended for REAL TIME scaling of images! Precalculate your images before running your program, or you will likely see massively slow renderings of graphics.
-; Set Graphics Mode
-Graphics 800,600,16
-
-; Randomize the random seed
-SeedRnd MilliSecs()
-
-; Load an image to tile (your location might vary)
-gfxBall=LoadImage("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Size it randomly from 300 to -300 both x and y
-ResizeImage gfxBall,Rnd(-300,300),Rnd(-300,300)
-
-; Wait for ESC to hit
-While Not KeyHit(1)
-DrawImage gfxball,Rnd(800),Rnd(600)
-VWait
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Restore.htm b/_release/help/commands/2d_commands/Restore.htm
index 03695e5..ccfd472 100644
--- a/_release/help/commands/2d_commands/Restore.htm
+++ b/_release/help/commands/2d_commands/Restore.htm
@@ -1,29 +1,65 @@
-Command: Restore Restore label Definition:
Moves the Data pointer to the selected label.
Parameter Description:
label = any valid and exisiting label
Command Description:
When using Data statements to store large blocks of constants for use with the Read command, it is necessary to denote the start of the Data with a .Label. The Restore command moves the 'pointer' to the first Data statement's value following the designated label. You MUST use the Restore label command prior to using the Read command. This method allows you to store groups of Data statements non-sequentially. Its different (if you are used to other BASIC languages) but you will find it most flexible. See the example and other commands related to Data command.
+When using Data statements to store large blocks of constants for use with the Read command, it is necessary to denote the start of the Data with a .Label. The Restore command moves the 'pointer' to the first Data statement's value following the designated label. You MUST use the Restore label command prior to using the Read command. This method allows you to store groups of Data statements non-sequentially. Its different (if you are used to other BASIC languages) but you will find it most flexible. See the example and other commands related to Data command.
-; Let's put the data pointer to the second data set
-Restore seconddata
-; Let's print them all to the screen
-For t = 1 To 10
-Read num ; Get the next data value in the data stack
-Print num
-Next
+See also: Read, Data.
+
+; Sample of read/restore/data/label commands
+
+; Let's put the data pointer to the second data set
+Restore seconddata
+
+; Let's print them all to the screen
+For t = 1 To 10
+Read num ; Get the next data value in the data stack
+Print num
+Next
+
+; Now for the first set of data
+Restore firstdata
+
+; Let's print them all to the screen
+For t = 1 To 10
+Read num ; Get the next data value in the data stack
+Print num
+Next
+
+; this is the first set of data
+.firstdata
+Data 1,2,3,4,5,6,7,8,9,10
+
+; this is the second set of data
+.seconddata
+Data 11,12,13,14,15,16,17,18,19,20
+
+
+
-; Now for the first set of data
-Restore firstdata
+Index
-; Let's print them all to the screen
-For t = 1 To 10
-Read num ; Get the next data value in the data stack
-Print num
-Next
-
-; this is the first set of data
-.firstdata
-Data 1,2,3,4,5,6,7,8,9,10
-
-; this is the second set of data
-.seconddata
-Data 11,12,13,14,15,16,17,18,19,20
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ResumeChannel.htm b/_release/help/commands/2d_commands/ResumeChannel.htm
index 61d7451..508583c 100644
--- a/_release/help/commands/2d_commands/ResumeChannel.htm
+++ b/_release/help/commands/2d_commands/ResumeChannel.htm
@@ -1,56 +1,55 @@
-Command: ResumeChannel
-
-
+Blitz3D Docs
+
-
-
-
ResumeChannel
-
-
-Parameters:
-
-
-
-
channel -- a music or sound channel previously allocated via LoadSound, PlayMusic, etc.
-
-
-
Description:
-
-
-
-
ResumeChannel is used to continue the playing of a sound sample or music track on the given channel after you have temporarily halted playback on that channel (via PauseChannel).
-Graphics 640, 480, 0, 2
-
-musicchannel = PlayMusic ("oohyeahbaby.mp3") ; Replace with a music file on your hard drive!
-
-Repeat
-
- Print "Press a key to pause the music..."
- WaitKey
-
- PauseChannel musicchannel
-
- Print "Press a key to continue the music..."
- WaitKey
-
- ResumeChannel musicchannel
-
-Until KeyHit (1)
-
-End
+
ResumeChannel channel
+
Parameters
+
+
+
+channel - a music or sound channel previously allocated via LoadSound, PlayMusic, etc.
-
+
-
+
Description
+
+
+
+ResumeChannel is used to continue the playing of a sound sample or music track on the given channel after you have temporarily halted playback on that channel (via PauseChannel).
+
+Graphics 640, 480, 0, 2
+
+musicchannel = PlayMusic ("oohyeahbaby.mp3") ; Replace with a music file on your hard drive!
+
+Repeat
+
+ Print "Press a key to pause the music..."
+ WaitKey
+
+ PauseChannel musicchannel
+
+ Print "Press a key to continue the music..."
+ WaitKey
+
+ ResumeChannel musicchannel
+
+Until KeyHit (1)
+
+End
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Return.htm b/_release/help/commands/2d_commands/Return.htm
index ed3405a..881ff92 100644
--- a/_release/help/commands/2d_commands/Return.htm
+++ b/_release/help/commands/2d_commands/Return.htm
@@ -1,25 +1,60 @@
-Command: Return Return value Definition:
Immediately exits a function with an optional return value or resumes execution from a subroutine called with Gosub.
Parameter Description:
value = TRUE or FALSE
Command Description:
When called inside a FUNCTION structure, the RETURN command immediately returns from the function back to the calling code. An optional value may be returned. See FUNCTION for more information. Remember, after a Return, the remaining code of the Function is not executed. See example.
-
-It also returns execution from a subroutine called with the Gosub command.
-
Example:
; RETURN example
+
+
+Blitz3D Docs
+
+
+
+
Return value
+
Parameters
+
+
+
+Return can pass a value back to the calling function of the type declared in the function name.
+
+No value can be returned when used with Gosub.
+
+
+
+
Description
+
+
+
+When called inside a FUNCTION structure, the RETURN command immediately returns from the function back to the calling code. An optional value may be returned. See FUNCTION for more information. Remember, after a Return, the remaining code of the Function is not executed. See example. It also returns execution from a subroutine called with the Gosub command.
-; Set result to the return value of the function 'testme'
-result=testme(Rnd(0,10));
-; The program effectively ends here.
+See also: Function, Gosub, Goto.
+
+; RETURN example
+
+; Set result to the return value of the function 'testme'
+result=testme(Rnd(0,10));
+
+; The program effectively ends here.
+
+; The actual function
+Function testme(test);
+
+; If the random number passed = 0
+If test=0 Then
+Print "Value was 0"
+Return False ; The Function ends immediately
+Else
+Print "The value was greater than 0"
+Return True ; The Function ends immediately
+End If
+Print "This line never gets printed!"
+End Function
+
+
+
-; The actual function
-Function testme(test);
+Index
-; If the random number passed = 0
-If test=0 Then
-Print "Value was 0"
-Return False ; The Function ends immediately
-Else
-Print "The value was greater than 0"
-Return True ; The Function ends immediately
-End If
-Print "This line never gets printed!"
-End Function
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Right.htm b/_release/help/commands/2d_commands/Right.htm
index d562334..629b791 100644
--- a/_release/help/commands/2d_commands/Right.htm
+++ b/_release/help/commands/2d_commands/Right.htm
@@ -1,6 +1,39 @@
-Command: Right$ Right$ (string$, length) Definition:
Return a specified number of characters from the rightmost side of a string.
Parameter Description:
string$ = any valid string variable
-length = the number of characters on the right to return
-
Command Description:
You can retrieve a certain number of characters from the rightmost side of a string. See the example.
Example:
name$="Bill Wallace"
-Print "The last 4 letters of your name are: " + Right$(name$,4)
-
+name$="Bill Wallace"
+Print "The last 4 letters of your name are: " + Right$(name$,4)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Rnd.htm b/_release/help/commands/2d_commands/Rnd.htm
index 4366e2c..31abb13 100644
--- a/_release/help/commands/2d_commands/Rnd.htm
+++ b/_release/help/commands/2d_commands/Rnd.htm
@@ -1,4 +1,38 @@
-Command: Rnd Rnd (start#,end#) Definition:
Returns a random number.
Parameter Description:
start# = Lowest value to generate
-end# = Highest value to generate
Command Description:
This returns either a floating point or integer number of a random value falling between the start and end number. It returns an integer if assiged to an integer variable, and it returns a floating point value if assiged to a floating number variable. The start and end values are inclusive. Be sure to use the SeedRnd command to avoid generating the same random numbers every time the program is run.
Example:
y=Rnd(0,10) ; Set y to a random integer between 0 and 10
-y#=Rnd(0,5) ; Set y floating value between 0.000000 and 10.000000
+start# = Lowest value to generate
+end# = Highest value to generate
+
+
+
+
Description
+
+
+
+This returns either a floating point or integer number of a random value falling between the start and end number. It returns an integer if assiged to an integer variable, and it returns a floating point value if assiged to a floating number variable. The start and end values are inclusive. Be sure to use the SeedRnd command to avoid generating the same random numbers every time the program is run.
+
+y=Rnd(0,10) ; Set y to a random integer between 0 and 10
+y#=Rnd(0,5) ; Set y floating value between 0.000000 and 5.000000
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/RotateImage.htm b/_release/help/commands/2d_commands/RotateImage.htm
index 3e48772..0ff3ee6 100644
--- a/_release/help/commands/2d_commands/RotateImage.htm
+++ b/_release/help/commands/2d_commands/RotateImage.htm
@@ -1,41 +1,74 @@
-Command: RotateImage RotateImage image,value# Definition:
Rotates the image counter-clockwise a specific angle.
Parameter Description:
image = variable containing the image handle
-value# = floating number from 0 to 350 degrees
Command Description:
I'm going to start this description off with:
+
+
+Blitz3D Docs
+
+
+
+
RotateImage image,value#
+
Parameters
+
+
+
+image = variable containing the image handle
+value# = floating number from 0 to 360 degrees
+
+
+
+
Description
+
+
+
+I'm going to start this description off with:
+
+This command is not fast enough to render rotations in real time!
+
+Now, the purpose of this command is to rotate an image a specified number of degrees. Since it is slow, you will need to pre-calculate rotated images with this command. This means, before the program actually displays the images you rotate, you will want to rotate them ahead of time.
+
+This command automatically dithers/anti-aliases the rotated graphic image, so it might mess with your transparency. To avoid this issue, use the TFormFilter command. This will render the rotated images with bi-linear filtering.
+
+I'm going to end this command with:
+
+This command is not fast enough to render rotations in real time!
+
+; RotateImage/TFormFilter Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Change the 0 to a 1 to see the difference
+; between filter on and off.
+TFormFilter 0
+
+; Create new empty graphic to store our circle in
+gfxBox=CreateImage(50,50)
+
+; Draw the box image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxBox)
+Color 255,0,0
+; Note the extra space between the box and the edge of the graphic
+Rect 10,10,30,30,1
+SetBuffer FrontBuffer()
+
+While Not KeyHit(1)
+; Make a copy of the image so we are always using a fresh one each time
+; we rotate it.
+gfxTemp=CopyImage(gfxBox)
+; Rotate it a random value and draw it at a random location
+RotateImage gfxTemp,Rnd(360)
+DrawImage gfxTemp,Rnd(640),Rnd(480)
+Wend
+
+
+
-This command is not fast enough to render rotations in real time!
+Index
-Now, the purpose of this command is to rotate an image a specified number of degrees. Since it is slow, you will need to pre-calculate rotated images with this command. This means, before the program actually displays the images you rotate, you will want to rotate them ahead of time.
-
-This command automatically dithers/anti-aliases the rotated graphic image, so it might mess with your transparency. To avoid this issue, use the TFormFilter command. This will render the rotated images with bi-linear filtering.
-
-I'm going to end this command with:
-
-This command is not fast enough to render rotations in real time!
-
Example:
; RotateImage/TFormFilter Example
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Change the 0 to a 1 to see the difference
-; between filter on and off.
-TFormFilter 0
-
-; Create new empty graphic to store our circle in
-gfxBox=CreateImage(50,50)
-
-; Draw the box image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxBox)
-Color 255,0,0
-; Note the extra space between the box and the edge of the graphic
-Rect 10,10,30,30,1
-SetBuffer FrontBuffer()
-
-While Not KeyHit(1)
-; Make a copy of the image so we are always using a fresh one each time
-; we rotate it.
-gfxTemp=CopyImage(gfxBox)
-; Rotate it a random value and draw it at a random location
-RotateImage gfxTemp,Rnd(360)
-DrawImage gfxTemp,Rnd(640),Rnd(480)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/RuntimeError.htm b/_release/help/commands/2d_commands/RuntimeError.htm
index f57c130..7da4adb 100644
--- a/_release/help/commands/2d_commands/RuntimeError.htm
+++ b/_release/help/commands/2d_commands/RuntimeError.htm
@@ -1,5 +1,38 @@
-Command: RuntimeError RuntimeError message$ Definition:
Pops up an error dialog box with a specified message.
Parameter Description:
message$ = Any valid string
Command Description:
When doing your own error trapping, use this command to pop up a fatal error and close the program. You can specify the error message that is displayed.
Example:
;There was a problem - raise an error and quit
+
+
+Blitz3D Docs
+
+
+
+
RuntimeError message$
+
Parameters
+
+
+
+message$ = Any valid string
+
+
+
+
Description
+
+
+
+When doing your own error trapping, use this command to pop up a fatal error and close the program. You can specify the error message that is displayed.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Sar.htm b/_release/help/commands/2d_commands/Sar.htm
index 906b1e7..60c20c1 100644
--- a/_release/help/commands/2d_commands/Sar.htm
+++ b/_release/help/commands/2d_commands/Sar.htm
@@ -1,25 +1,61 @@
-Command: Sar Sar repetitions Definition:
Performs binary shift right.
Parameter Description:
repetitions = number of shifts to make right
Command Description:
This performs a left binary shift on the value the specified number of times. This basically is a faster method of dividing the value exponentially. By shifting right once, you are dividing the value by 2. By shifting right twice, you divide by 4, etc.
+
+
+Blitz3D Docs
+
+
+
+
Sar repetitions
+
Parameters
+
+
+
+repetitions = number of shifts to make right
+
+
+
+
Description
+
+
+
+This performs a right binary shift on the value the specified number of times. This basically is a faster method of dividing the value exponentially. By shifting right once, you are dividing the value by 2. By shifting right twice, you divide by 4, etc.
+
+Sar command varies from Shr whereas it fills blank bits shifted with copies of the sign bit, 0 for positive numbers and 1 for negative.
+The usefulness of this command is basically faster math execution. Also see Shl.
-Sar command varies from Shr whereas it fills blank bits shifted with copies of the sign bit, 0 for positive numbers and 1 for negative.
-The usefulness of this command is basically faster math execution. Also see Shl.
+; shl, shr, sar examples
+
+value = 100
+
+; multiple x 2
+Print "Shift 1 bit left; Value = " + value Shl 1
+; multiple x 4
+Print "Shift 2 bits left; Value = " + value Shl 2
+; multiple x 16
+Print "Shift 4 bits left; Value = " + value Shl 4
+; divide by 2
+Print "Shift 1 bit right; Value = " + value Shr 1
+; divide by 4
+Print "Shift 2 bits right; Value = " + value Shr 2
+; divide by 16
+Print "Shift 4 bits right; Value = " + value Shr 4
+
+Print "Shift by SAR 4 times = " + value Sar 4
+
+WaitKey()
+
-; multiple x 2
-Print "Shift 1 bit left; Value = " + value Shl 1
-; multiple x 4
-Print "Shift 2 bits left; Value = " + value Shl 2
-; multiple x 16
-Print "Shift 4 bits left; Value = " + value Shl 4
-; divide by 2
-Print "Shift 1 bit right; Value = " + value Shr 1
-; divide by 4
-Print "Shift 2 bits right; Value = " + value Shr 2
-; divide by 16
-Print "Shift 4 bits right; Value = " + value Shr 4
-
-Print "Shift by SAR 4 times = " + value Sar 4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SaveBuffer.htm b/_release/help/commands/2d_commands/SaveBuffer.htm
index f723bef..02d3c70 100644
--- a/_release/help/commands/2d_commands/SaveBuffer.htm
+++ b/_release/help/commands/2d_commands/SaveBuffer.htm
@@ -1,9 +1,42 @@
-Command: SaveBuffer SaveBuffer (buffer,filename$) Definition:
Saves the selected video buffer to a bitmap file.
Parameter Description:
buffer = The buffer to save; FrontBuffer() or BackBuffer()
-filename$ = valid Windows path/filename
-
Command Description:
Typically, this is used to take a screen snapshot. This will save the screen buffer you specify to a .bmp file you specify. Remember, use the proper name for the buffer you wish to save; FrontBuffer() for the current visible screen, and BackBuffer() for the back or invisible drawing buffer. The filename must be valid Windows filename syntax.
Example:
; Save the screen when player pushes F10
+
+
+Blitz3D Docs
+
+
+
+
SaveBuffer (buffer,filename$)
+
Parameters
+
+
+
+buffer = The buffer to save; FrontBuffer() or BackBuffer()
+filename$ = valid Windows path/filename
+
+
+
+
Description
+
+
+
+Typically, this is used to take a screen snapshot. This will save the screen buffer you specify to a .bmp file you specify. Remember, use the proper name for the buffer you wish to save; FrontBuffer() for the current visible screen, and BackBuffer() for the back or invisible drawing buffer. The filename must be valid Windows filename syntax.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SaveImage.htm b/_release/help/commands/2d_commands/SaveImage.htm
index f15f9d1..316822b 100644
--- a/_release/help/commands/2d_commands/SaveImage.htm
+++ b/_release/help/commands/2d_commands/SaveImage.htm
@@ -1,24 +1,59 @@
-Command: SaveImage SaveImage (image,bmpfile$,[frame] ) Definition:
Saves an image to hard drive as a .bmp file.
Parameter Description:
image = variable handle to the image to save
-bmpfile$ = string with full path and filename to save to
-frame = optional; which frame of the image to save
Command Description:
Saves an image or one of its frames to hard drive. You will need an existing image to save off. This returns a 1 if the save was successful, 0 if not.
Example:
; SaveImage example
+
+
+Blitz3D Docs
+
+
+
+
SaveImage (image,bmpfile$[,frame] )
+
Parameters
+
+
+
+image = variable handle to the image to save
+bmpfile$ = string with full path and filename to save to
+frame = optional; which frame of the image to save
+
+
+
+
Description
+
+
+
+Saves an image or one of its frames to hard drive. You will need an image in memory to save. This returns a 1 if the save was successful, 0 if not.
+
+; SaveImage example
+
+; Set Graphics Mode
+Graphics 800,600,16
+
+; Load an image to tile (your location might vary)
+gfxBall=LoadImage("C:Program Files\Blitz Basic\samples\ball.bmp")
+
+; Save the image to the c: drive ...
+ok=SaveImage (gfxBall,"c:
+ewball.bmp")
+
+; Print results
+If ok=1 Then
+Print "Save successful!"
+Else
+Print "There was an error saving!"
+End If
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+Wend
+
-; Load an image to tile (your location might vary)
-gfxBall=LoadImage("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Save the image to the c: drive ...
-ok=SaveImage (gfxBall,"c:\newball.bmp")
-
-; Print results
-If ok=1 Then
-Print "Save successful!"
-Else
-Print "There was an error saving!"
-End If
-
-; Wait for ESC to hit
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ScaleImage.htm b/_release/help/commands/2d_commands/ScaleImage.htm
index 1a3d728..789e35f 100644
--- a/_release/help/commands/2d_commands/ScaleImage.htm
+++ b/_release/help/commands/2d_commands/ScaleImage.htm
@@ -1,25 +1,59 @@
-Command: ScaleImage ScaleImage image,xscale#,yscale# Definition:
Scales an image to a new size using percentages.
Parameter Description:
image = file handle variable to a previously loaded image
-xscale# = the amount to scale the image horizontally
-yscale# = the amount to scale the image vertically
-
Command Description:
Use this command to rescale an image to a new size using a floating point percentage (1.0 = 100%, 2.0 = 200%, etc). Using a negative value perform image flipping. You must've previously loaded the image with LoadImage or LoadAnimImage.
+
+
+Blitz3D Docs
+
+
+
+
ScaleImage image,xscale#,yscale#
+
Parameters
+
+
+
+image = file handle variable to a previously loaded image
+xscale# = the amount to scale the image horizontally
+yscale# = the amount to scale the image vertically
+
+
+
+
Description
+
+
+
+Use this command to rescale an image to a new size using a floating point percentage (1.0 = 100%, 2.0 = 200%, etc). Using a negative value perform image flipping. You must've previously loaded the image with LoadImage or LoadAnimImage.
+
+This is NOT intended for REAL TIME scaling of images! Precalculate your images before running your program, or you will likely see massively slow renderings of graphics.
+
+; ScaleImage example
+
+; Set Graphics Mode
+Graphics 800,600,16
+
+; Randomize the random seed
+SeedRnd MilliSecs()
+
+; Load an image to tile (your location might vary)
+gfxBall=LoadImage("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Scale it randomly from 50% to 150% both x and y
+ScaleImage gfxBall,Rnd(-2.0,2.0),Rnd(-2.0,2.0)
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+DrawImage gfxball,Rnd(800),Rnd(600)
+VWait
+Wend
+
+
+
+
-This is NOT intended for REAL TIME scaling of images! Precalculate your images before running your program, or you will likely see massively slow renderings of graphics.
-; Set Graphics Mode
-Graphics 800,600,16
-
-; Randomize the random seed
-SeedRnd MilliSecs()
-
-; Load an image to tile (your location might vary)
-gfxBall=LoadImage("C:\Program Files\Blitz Basic\samples\ball.bmp")
-
-; Scale it randomly from 50% to 150% both x and y
-ScaleImage gfxBall,Rnd(-2.0,2.0),Rnd(-2.0,2.0)
-
-; Wait for ESC to hit
-While Not KeyHit(1)
-DrawImage gfxball,Rnd(800),Rnd(600)
-VWait
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ScanLine.htm b/_release/help/commands/2d_commands/ScanLine.htm
index c65ea4d..08b4d53 100644
--- a/_release/help/commands/2d_commands/ScanLine.htm
+++ b/_release/help/commands/2d_commands/ScanLine.htm
@@ -1,7 +1,43 @@
-Command: ScanLine() ScanLine() Definition:
Returns the scanline location of the drawing operation.
Parameter Description:
None.
Command Description:
If for some reason you need to know the current scanline location of the drawing system, here is how you get it.
Example:
; ScanLine() Example
+
+
+Blitz3D Docs
+
+
+
+
ScanLine()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+If for some reason you need to know the current scanline location of the drawing system, here is how you get it.
-While Not KeyHit(1)
-Print ScanLine()
-Wend
-
+; ScanLine() Example
+
+While Not KeyHit(1)
+Print ScanLine()
+Wend
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SeedRnd.htm b/_release/help/commands/2d_commands/SeedRnd.htm
index ecaf79f..39055b8 100644
--- a/_release/help/commands/2d_commands/SeedRnd.htm
+++ b/_release/help/commands/2d_commands/SeedRnd.htm
@@ -1,2 +1,36 @@
-Command: SeedRnd SeedRnd seed Definition:
Sets the random number generator with a seed value.
Parameter Description:
seed = valid integer number
Command Description:
Computer random number generators are not truly random. They generate numbers based on a seed value (an integer number). If you 'seed' the random number generator with the same seed, it will always generate the same set of numbers. Use this command to ensure you get a good set of numbers. Usually you set the seed value to a timer or system clock value to ensure that each time the program is run, a new value is seeded. Look at the example for normal usage of this command.
Example:
SeedRnd Millisecs() ; Seed the randomizer with the current system time in milliseconds.
+Computer random number generators are not truly random. They generate numbers based on a seed value (an integer number). If you 'seed' the random number generator with the same seed, it will always generate the same set of numbers. Use this command to ensure you get a good set of numbers. Usually you set the seed value to a timer or system clock value to ensure that each time the program is run, a new value is seeded. Look at the example for normal usage of this command.
+
+SeedRnd Millisecs() ; Seed the randomizer with the current system time in milliseconds.
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SeekFile.htm b/_release/help/commands/2d_commands/SeekFile.htm
index 3ba6a36..96ee54c 100644
--- a/_release/help/commands/2d_commands/SeekFile.htm
+++ b/_release/help/commands/2d_commands/SeekFile.htm
@@ -1,68 +1,96 @@
-Command: SeekFile SeekFile (filehandle, offset) Definition:
Moves the current pointer inside an open file to a new location.
Parameter Description:
filehandle = the variable returned by the Readfile, WriteFile or OpenFile when the file was opened.
-The value returned is the offset from the start of the file. ( 0 = Start of the file )
Command Description:
This command allows the position in a file to be changed. This allows random access to data within files and can be used with files opened by ReadFile, WriteFile and OpenFile. Note, the offset is the number of bytes from the start of the file, where the first byte is at offset 0. It is
-important to take account of the size of the data elements in your file.
+
+
+Blitz3D Docs
+
+
+
+
SeekFile (filehandle, offset)
+
Parameters
+
+
+
+filehandle = the variable returned by the Readfile, WriteFile or OpenFile when the file was opened. The value returned is the offset from the start of the file. ( 0 = Start of the file )
+
+
+
+
Description
+
+
+
+This command allows the position in a file to be changed. This allows random access to data within files and can be used with files opened by ReadFile, WriteFile and OpenFile. Note, the offset is the number of bytes from the start of the file, where the first byte is at offset 0. It is important to take account of the size of the data elements in your file.
+
+For instance Integers are 4 bytes long so the first integer in the file is at offset 0 and the second at offset 4. If you write Custom Data types out then you must work out haw many bytes each takes so that you can move about the file correctly. Seeking beyond the end of a file does not generate an error but the data is not read or written to the file, and may course unknown side effects.
+
+By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working through the whole file sequentially. This could be useful if you have created a database file and you want to find and update just a few records within it. It is also possible to create an index file that contains pointers to where each record starts in a data file.
+
+To calculate an offset you need to know how long each data element is; Offset = Wanted_Element * size_of_element - size_of_element
+
+For example a file of integers which are 4 bytes long is calculated by:
+
+The 7th integer is at offset 7 * 4 - 4 i.e. 24
+
+Note, extreme care needs to be exercised when updating files that contain strings since these are not fixed in length.
+
+; Changing part of a file using OpenFile, SeekFile, FilePos
+
+; Open/create a file to Write
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteInt( fileout, 100 )
+WriteInt( fileout, 200 )
+WriteInt( fileout, 300 )
+WriteInt( fileout, 400 )
+WriteInt( fileout, 500 )
+
+; Close the file
+CloseFile( fileout )
+
+DisplayFile( "The file as originally written", mydata.dat" )
+
+Print "Data read in random order"
+; Open the file to read just the 4th and 2nd elements from
+
+file = OpenFile("mydata.dat")
+
+; read and print the 4th integer ie 4*4-4 = 12 byte from the start of the file
+SeekFile( file, 12 ) ; Move to the found location
+Number = ReadInt( file )
+Print Number
+
+; read and print the 2th integer ie 2*4-4 = 4 bytes from the start of the file
+SeekFile( file, 4 ) ; Move to the found location
+Number = ReadInt( file )
+Print Number
+
+CloseFile( file )
+
+Waitkey()
+End ; End of program
+
+; **** Function Definitions follow ****
+; Read the file and print it
+Function DisplayFile( Tittle$, Filename$ )
+Print tittle$
+file = ReadFile( Filename$ )
+While Not Eof( file )
+Number = ReadInt( file )
+Print Number
+Wend
+CloseFile( file )
+Print
+End Function
+
+
+
-For instance Integers are 4 bytes long so the first integer in the file is at offset 0 and the second at offset 4. If you write Custom Data types out then you must work out haw many bytes each takes so that you can move about the file correctly. Seeking beyond the end of a file does not generate an error but the data is not read or written to the file, and may course unknown side effects.
+Index
-By using FilePos and SeekFile the position within the file that is being read or written can be determined and also changed. This allows a file to be read and updated without having to make a new copy of the file or working through the whole file sequentially. This could be useful if you have
-created a database file and you want to find and update just a few records within it. It is also possible to create an index file that contains pointers to where each record starts in a data file.
-
-To calculate an offset you need to know how long each data element is; Offset = Wanted_Element * size_of_element - size_of_element
-
-For example a file of integers which are 4 bytes long is calculated by:
-
-The 7th integer is at offset 7 * 4 - 4 i.e. 24
-
-Note, extreme care needs to be exercised when updating files that contain strings since these are not fixed in length.
-
-See also:
-ReadByte, ReadShort, ReadInt, ReadFloat, ReadString$, ReadLine$, WriteByte, WriteShort, WriteInt, WriteFloat, WriteShort, WriteString, WriteLine, ReadFile, WriteFile, OpenFile, CloseFile, Eof, FileType, FilePos, SeekFile
Example:
; Changing part of a file using OpenFile, SeekFile, FilePos
-
-; Open/create a file to Write
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteInt( fileout, 100 )
-WriteInt( fileout, 200 )
-WriteInt( fileout, 300 )
-WriteInt( fileout, 400 )
-WriteInt( fileout, 500 )
-
-; Close the file
-CloseFile( fileout )
-
-DisplayFile( "The file as originally written", mydata.dat" )
-
-Print "Data read in random order"
-; Open the file to read just the 4th and 2nd elements from
-
-file = OpenFile("mydata.dat")
-
-; read and print the 4th integer ie 4*4-4 = 12 byte from the start of the file
-SeekFile( file, 12 ) ; Move to the found location
-Number = ReadInt( file )
-Print Number
-
-; read and print the 2th integer ie 2*4-4 = 4 bytes from the start of the file
-SeekFile( file, 4 ) ; Move to the found location
-Number = ReadInt( file )
-Print Number
-
-CloseFile( file )
-
-Waitkey()
-End ; End of program
-
-; **** Function Definitions follow ****
-; Read the file and print it
-Function DisplayFile( Tittle$, Filename$ )
- Print tittle$
- file = ReadFile( Filename$ )
- While Not Eof( file )
- Number = ReadInt( file )
- Print Number
- Wend
- CloseFile( file )
- Print
-End Function
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Select.htm b/_release/help/commands/2d_commands/Select.htm
index 882780d..50522f5 100644
--- a/_release/help/commands/2d_commands/Select.htm
+++ b/_release/help/commands/2d_commands/Select.htm
@@ -1,30 +1,67 @@
-Command: Select Select variable Definition:
Executes commands based on the value of a provided variable.
Parameter Description:
variable - any valid variable
Command Description:
This command allows you to set up a selection structure that, based on the value of the variable you feed it, will execute different commands in different CASEs. You can also specify a DEFAULT set of commands to happen if NONE of the CASEs are met. The selection structure is ended with an END SELECT command.
+
+
+Blitz3D Docs
+
+
+
+
Select variable
+
Parameters
+
+
+
+variable - any valid variable
+
+
+
+
Description
+
+
+
+This command allows you to set up a selection structure that, based on the value of the variable you feed it, will execute different commands in different CASEs. You can also specify a DEFAULT set of commands to happen if NONE of the CASEs are met. The selection structure is ended with an END SELECT command.
+
+
+This selection structure removes the need for large nested IF/THEN condition checking. See the example for more.
-This selection structure removes the need for large nested IF/THEN condition checking. See the example for more.
Example:
; SELECT/CASE/DEFAULT/END SELECT Example
-; Assign a random number 1-10
-mission=Rnd(1,10)
+See also: Case, Default, True, False, If.
+
+; SELECT/CASE/DEFAULT/END SELECT Example
+
+; Assign a random number 1-10
+mission=Rnd(1,10)
+
+; Start the selection process based on the value of 'mission' variable
+Select mission
+
+; Is mission = 1?
+Case 1
+Print "Your mission is to get the plutonium and get out alive!"
+
+; Is mission = 2?
+Case 2
+Print "Your mission is to destroy all enemies!"
+
+; Is mission = 3?
+Case 3
+Print "Your mission is to steal the enemy building plans!"
+
+; What do do if none of the cases match the value of mission
+Default
+Print "Missions 4-10 are not available yet!"
+
+; End the selection process
+End Select
+
+
+
-; Start the selection process based on the value of 'mission' variable
-Select mission
+Index
-; Is mission = 1?
-Case 1
-Print "Your mission is to get the plutonium and get out alive!"
-
-; Is mission = 2?
-Case 2
-Print "Your mission is to destroy all enemies!"
-
-; Is mission = 3?
-Case 3
-Print "Your mission is to steal the enemy building plans!"
-
-; What do do if none of the cases match the value of mission
-Default
-Print "Missions 4-10 are not available yet!"
-
-; End the selection process
-End Select
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SendNetMsg.htm b/_release/help/commands/2d_commands/SendNetMsg.htm
index d38a46e..1c602a6 100644
--- a/_release/help/commands/2d_commands/SendNetMsg.htm
+++ b/_release/help/commands/2d_commands/SendNetMsg.htm
@@ -1,94 +1,130 @@
-Command: SendNetMsg SendNetMsg type,data$,from,to,reliable Definition:
Sends a message during a network game.
Parameter Description:
type = value 1-99
-data$ = string containing message to send
-from = player ID of the sender
-to = player ID of the recipient (0=broadcast)
-reliable = flag for sending message reliably
Command Description:
First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+
+Blitz3D Docs
+
+
+
+
SendNetMsg type,data$,from,to,reliable
+
Parameters
+
+
+
+type = value 1-99
+data$ = string containing message to send
+from = player ID of the sender
+to = player ID of the recipient (0=broadcast)
+reliable = flag for sending message reliably
+
+
+
+
Description
+
+
+
+First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk).
+
+This is probably the most complicated of the networking commands. This what you use to actually send a message to one or all of the players on the network game. The other players will use RecvNetMsg() to intercept your message.
+The TYPE parameter is a number from 1 to 99. These values are denoted as 'user messages'.
+
+The Data$ parameter is the actual string that contains the message you want to send. Helpful to know that in order to keep traffic low, you will want to combine details of a message into a single message instead of sending multiple messages with a single element. For example, you might want to send X, Y, and FRAME in a single string like "200,100,4" and parse it out at the recipient's end.
+
+FROM is the player's ID that is sending the message. This is the value returned from the CreateNetPlayer() command.
+
+TO is the player's ID you wish to send the message to. A default value of 0 will broadcast to ALL players.
+
+The RELIABLE flag will put a priority on the message and it will ensure there is no packet loss in the delivery. However, it is at least 3 times slower than a regular non-reliable message.
+
+The example requires that you run it on the local machine while the remote computer runs the example in the RecvNetMsg() command.
+
+; SendNetMsg example
+; ------------------
+; Run this example on the local computer
+; run the example for RecvNetMsg() on a remote computer
+
+; Graphics mode with double buffering
+Graphics 640,480,16
+SetBuffer BackBuffer()
+
+; Create a network game with NO requester
+joinStatus=HostNetGame("ShaneGame")
+
+; A type to hold all the player's information
+Type multi
+Field x
+Field y
+Field id
+Field name$
+Field xspeed
+Field boxColor
+End Type
+
+; make sure the game started ok...
+If joinStatus=2 Then
+Print "Hosted game started... "
+Else
+Print "Hosted game could not be started!"
+End
+End If
+
+; Create 5 local players using TYPEs
+For t = 1 To 5
+; New type instance
+player.multi = New Multi
+; Assign the ID field with the created player ID and name him
+playerID=CreateNetPlayer("Player" + t)
+
+; if the player was created ok ... assign some random parameters
+If playerID <> 0 Then
+player
+ame$="Player" + t
+playerx = Rand(640)
+playery = Rand(480)
+playeroxColor = Rand(255)
+playerxspeed = Rand(1,5)
+; Print some text results
+Print "Player " + t + " has joined the game with ID=" + playerID
+Else
+Print "The player couldn't join! Aborting!"
+End If
+Next
+
+; We've got them all! Wait for a key
+Print "All local players are joined! Press a key ..."
+WaitKey()
+
+; Loop this routine
+While Not KeyHit(1)
+Cls
+; for each of the players, update their locations on the screen
+For player = Each multi
+Color playeroxColor,playeroxColor,playeroxColor
+Rect playerx,playery,10,10,1
+Text playerx-10,playery-15,player
+ame$
+playerx = playerx + playerxspeed
+If playerx > 640 Or playerx < 0 Then
+playerxspeed=-playerxspeed
+message$="Player ID #" + playerID + " hit a wall!"
+; Send a broadcast message if a player rebounds off the wall
+; this message will show up on the remote machine
+SendNetMsg Rand(1,99),message$,playerid,0
+End If
+Next
+Flip
+Wend
+End
+
+
+
+
-This is probably the most complicated of the networking commands. This what you use to actually send a message to one or all of the players on the network game. The other players will use RecvNetMsg() to intercept your message.
+Index
-The TYPE parameter is a number from 1 to 99. These values are denoted as 'user messages'.
-
-The Data$ parameter is the actual string that contains the message you want to send. Helpful to know that in order to keep traffic low, you will want to combine details of a message into a single message instead of sending multiple messages with a single element. For example, you might want to send X, Y, and FRAME in a single string like "200,100,4" and parse it out at the recipient's end.
-
-FROM is the player's ID that is sending the message. This is the value returned from the CreateNetPlayer() command.
-
-TO is the player's ID you wish to send the message to. A default value of 0 will broadcast to ALL players.
-
-The RELIABLE flag will put a priority on the message and it will ensure there is no packet loss in the delivery. However, it is at least 3 times slower than a regular non-reliable message.
-
-The example requires that you run it on the local machine while the remote computer runs the example in the RecvNetMsg() command.
Example:
; SendNetMsg example
-; ------------------
-; Run this example on the local computer
-; run the example for RecvNetMsg() on a remote computer
-
-; Graphics mode with double buffering
-Graphics 640,480,16
-SetBuffer BackBuffer()
-
-; Create a network game with NO requester
-joinStatus=HostNetGame("ShaneGame")
-
-; A type to hold all the player's information
-Type multi
- Field x
- Field y
- Field id
- Field name$
- Field xspeed
- Field boxColor
-End Type
-
-; make sure the game started ok...
-If joinStatus=2 Then
- Print "Hosted game started... "
-Else
- Print "Hosted game could not be started!"
-End
-End If
-
-; Create 5 local players using TYPEs
-For t = 1 To 5
-; New type instance
-player.multi = New Multi
-; Assign the ID field with the created player ID and name him
-player\ID=CreateNetPlayer("Player" + t)
-
-; if the player was created ok ... assign some random parameters
-If player\ID <> 0 Then
-player\name$="Player" + t
-player\x = Rand(640)
-player\y = Rand(480)
-player\boxColor = Rand(255)
-player\xspeed = Rand(1,5)
-; Print some text results
-Print "Player " + t + " has joined the game with ID=" + player\ID
-Else
-Print "The player couldn't join! Aborting!"
-End If
-Next
-
-; We've got them all! Wait for a key
-Print "All local players are joined! Press a key ..."
-WaitKey()
-
-; Loop this routine
-While Not KeyHit(1)
-Cls
-; for each of the players, update their locations on the screen
-For player = Each multi
-Color player\boxColor,player\boxColor,player\boxColor
-Rect player\x,player\y,10,10,1
-Text player\x-10,player\y-15,player\name$
-player\x = player\x + player\xspeed
-If player\x > 640 Or player\x < 0 Then
-player\xspeed=-player\xspeed
-message$="Player ID #" + player\ID + " hit a wall!"
-; Send a broadcast message if a player rebounds off the wall
-; this message will show up on the remote machine
-SendNetMsg Rand(1,99),message$,player\id,0
-End If
-Next
-Flip
-Wend
-End
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SetBuffer.htm b/_release/help/commands/2d_commands/SetBuffer.htm
index 54793e1..a207aaa 100644
--- a/_release/help/commands/2d_commands/SetBuffer.htm
+++ b/_release/help/commands/2d_commands/SetBuffer.htm
@@ -1,2 +1,36 @@
-Command: SetBuffer SetBuffer buffer Definition:
Used to set the current drawing buffer.
Parameter Description:
Buffers can either be the FrontBuffer(), BackBuffer() or an ImageBuffer() Default buffer is the FrontBuffer
Command Description:
Use this command to set the current drawing buffer. If not used the default buffer, FrontBuffer() is used. SetBuffer also resets the origin to 0,0 and the Viewpoint to the width and height of the buffer.
Example:
SetBuffer FrontBuffer() ;Sets FrontBuffer as the current drawing buffer
+Buffers can either be the FrontBuffer(), BackBuffer() or an ImageBuffer() Default buffer is the FrontBuffer
+
+
+
+
Description
+
+
+
+Use this command to set the current drawing buffer. If not used the default buffer, FrontBuffer() is used. SetBuffer also resets the origin to 0,0 and the Viewpoint to the width and height of the buffer.
+
+SetBuffer FrontBuffer() ;Sets FrontBuffer as the current drawing buffer
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SetFont.htm b/_release/help/commands/2d_commands/SetFont.htm
index 7986de3..d9a2da1 100644
--- a/_release/help/commands/2d_commands/SetFont.htm
+++ b/_release/help/commands/2d_commands/SetFont.htm
@@ -1,46 +1,80 @@
-Command: SetFont SetFont fonthandle Definition:
Sets a previously loaded font active for writing operations.
Parameter Description:
fontname = string containing font name
-height = font height desired
-bold = set to TRUE to load font as BOLD
-italic = set to TRUE to load font as ITALIC
-underlined set to TRUE to load font as UNDERLINED
-
Command Description:
This activates a TrueType font previously loaded into memory (though the LoadFont command) for future use with printing commands such as Text.
+
+
+Blitz3D Docs
+
+
+
+
SetFont fonthandle
+
Parameters
+
+
+
+fontname = string containing font name
+height = font height desired
+bold = set to TRUE to load font as BOLD
+italic = set to TRUE to load font as ITALIC
+underlined set to TRUE to load font as UNDERLINED
+
+
+
+
Description
+
+
+
+This activates a TrueType font previously loaded into memory (though the LoadFont command) for future use with printing commands such as Text.
+
+Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
+
+Be sure to free the memory used by the font went you are done using the FreeFont command.
+
+; LoadFont/SetFont/FreeFont example
+
+; enable graphics mode
+Graphics 800,600,16
+
+; Set global on font variables
+Global fntArial,fntArialB,fntArialI,fntArialU
+
+;Load fonts to a file handle variables
+fntArial=LoadFont("Arial",24,False,False,False)
+fntArialB=LoadFont("Arial",18,True,False,False)
+fntArialI=LoadFont("Arial",32,False,True,False)
+fntArialU=LoadFont("Arial",14,False,False,True)
+
+; set the font and print text
+SetFont fntArial
+Text 400,0,"This is just plain Arial 24 point",True,False
+
+SetFont fntArialB
+Text 400,30,"This is bold Arial 18 point",True,False
+
+SetFont fntArialI
+Text 400,60,"This is italic Arial 32 point",True,False
+
+SetFont fntArialU
+Text 400,90,"This is underlined Arial 14 point",True,False
+
+; Standard 'wait for ESC' from user
+While Not KeyHit(1)
+Wend
+
+; Clear all the fonts from memory!
+FreeFont fntArial
+FreeFont fntArialB
+FreeFont fntArialI
+FreeFont fntArialU
+
+
+
+
-Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
+Index
-Be sure to free the memory used by the font went you are done using the FreeFont command.
Example:
; LoadFont/SetFont/FreeFont example
-
-; enable graphics mode
-Graphics 800,600,16
-
-; Set global on font variables
-Global fntArial,fntArialB,fntArialI,fntArialU
-
-;Load fonts to a file handle variables
-fntArial=LoadFont("Arial",24,False,False,False)
-fntArialB=LoadFont("Arial",18,True,False,False)
-fntArialI=LoadFont("Arial",32,False,True,False)
-fntArialU=LoadFont("Arial",14,False,False,True)
-
-; set the font and print text
-SetFont fntArial
-Text 400,0,"This is just plain Arial 24 point",True,False
-
-SetFont fntArialB
-Text 400,30,"This is bold Arial 18 point",True,False
-
-SetFont fntArialI
-Text 400,60,"This is italic Arial 32 point",True,False
-
-SetFont fntArialU
-Text 400,90,"This is underlined Arial 14 point",True,False
-
-; Standard 'wait for ESC' from user
-While Not KeyHit(1)
-Wend
-
-; Clear all the fonts from memory!
-FreeFont fntArial
-FreeFont fntArialB
-FreeFont fntArialI
-FreeFont fntArialU
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SetGfxDriver.htm b/_release/help/commands/2d_commands/SetGfxDriver.htm
index e9078fa..6c169ec 100644
--- a/_release/help/commands/2d_commands/SetGfxDriver.htm
+++ b/_release/help/commands/2d_commands/SetGfxDriver.htm
@@ -1,22 +1,57 @@
-Command: SetGfxDriver SetGfxDriver index Definition:
Set the graphics driver for use with graphics commands.
Parameter Description:
index = index number obtained with CountGfxDrivers command
Command Description:
Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card).
+
+
+Blitz3D Docs
+
+
+
+
SetGfxDriver index
+
Parameters
+
+
+
+index = index number obtained with CountGfxDrivers command
+
+
+
+
Description
+
+
+
+Some computers may have more than one video card and/or video driver installed (a good example is a computer system with a primary video card and a Voodoo2 or other pass-through card).
+
+Once you know how many drivers there are using the CountGfxDrivers(), you can iterate through them with GfxDriverName$ and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with this command.
+
+Normally, this won't be necessary with 2D programming.
+
+; GfxDriver Examples
+
+; Count how many drivers there are
+totalDrivers=CountGfxDrivers()
+Print "Choose a driver to use:"
+
+; Go through them all and print their names (most people will have only 1)
+For t = 1 To totalDrivers
+Print t+") " + GfxDriverName$(t)
+Next
+
+; Let the user choose one
+driver=Input("Enter Selection:")
+
+; Set the driver!
+SetGfxDriver driver
+Print "Your driver has been selected!"
+
+
+
+
-Once you know how many drivers there are using the CountGfxDrivers(), you can iterate through them with GfxDriverName$ and display them for the user to choose from. Once the user has chosen (or you decide), you can set the graphics driver with this command.
+Index
-Normally, this won't be necessary with 2D programming.
Example:
; GfxDriver Examples
-
-; Count how many drivers there are
-totalDrivers=CountGfxDrivers()
-Print "Choose a driver to use:"
-
-; Go through them all and print their names (most people will have only 1)
-For t = 1 To totalDrivers
-Print t+") " + GfxDriverName$(t)
-Next
-
-; Let the user choose one
-driver=Input("Enter Selection:")
-
-; Set the driver!
-SetGfxDriver driver
-Print "Your driver has been selected!"
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Sgn.htm b/_release/help/commands/2d_commands/Sgn.htm
index 7d3a1d4..dd9808e 100644
--- a/_release/help/commands/2d_commands/Sgn.htm
+++ b/_release/help/commands/2d_commands/Sgn.htm
@@ -1,7 +1,42 @@
-Command: Sgn Sgn (number) Definition:
Returns the sign of the number argument.
Parameter Description:
number=float or integer
Command Description:
This function is used to determine whether a number or value is greater than 0, equal to 0 or less than 0. Note: non-integer values return the sign to 7 signigicant figures. (e.g. -1.000000)
Example:
Print Sgn(10) ; prints 1
-Print Sgn(5.5) ; prints 1.000000
-Print Sgn(0) ; prints 0
-Print Sgn(0.0) ; prints 0.000000
-Print Sgn(-5.5) ; prints -1.000000
-Print Sgn(-10) ; prints -1
+This function is used to determine whether a number or value is greater than 0, equal to 0 or less than 0. Note: non-integer values return the sign to 7 signigicant figures. (e.g. -1.000000)
+
+Print Sgn(10) ; prints 1
+Print Sgn(5.5) ; prints 1.000000
+Print Sgn(0) ; prints 0
+Print Sgn(0.0) ; prints 0.000000
+Print Sgn(-5.5) ; prints -1.000000
+Print Sgn(-10) ; prints -1
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Shl.htm b/_release/help/commands/2d_commands/Shl.htm
index 0ade4e8..d8f810f 100644
--- a/_release/help/commands/2d_commands/Shl.htm
+++ b/_release/help/commands/2d_commands/Shl.htm
@@ -1,23 +1,58 @@
-Command: Shl Shl repetitions Definition:
Performs binary shift left.
Parameter Description:
repetitions = number of shifts to make left
Command Description:
This performs a left binary shift on the value the specified number of times. This basically is a faster method of multiplying the value exponentially. By shifting left once, you are multiplying the value by 2. By shifting left twice, you multiple by 4, etc.
+
+
+Blitz3D Docs
+
+
+
+
Shl repetitions
+
Parameters
+
+
+
+repetitions = number of shifts to make left
+
+
+
+
Description
+
+
+
+This performs a left binary shift on the value the specified number of times. This basically is a faster method of multiplying the value exponentially. By shifting left once, you are multiplying the value by 2. By shifting left twice, you multiple by 4, etc.
+
+The usefulness of this command is basically faster math execution.
+
+; shl, shr, sar examples
+
+value = 100
+
+; multiple x 2
+Print "Shift 1 bit left; Value = " + value Shl 1
+; multiple x 4
+Print "Shift 2 bits left; Value = " + value Shl 2
+; multiple x 16
+Print "Shift 4 bits left; Value = " + value Shl 4
+; divide by 2
+Print "Shift 1 bit right; Value = " + value Shr 1
+; divide by 4
+Print "Shift 2 bits right; Value = " + value Shr 2
+; divide by 16
+Print "Shift 4 bits right; Value = " + value Shr 4
+
+Print "Shift by SAR 4 times = " + value Sar 4
+
+WaitKey()
+
+
+
+
-The usefulness of this command is basically faster math execution.
-value = 100
-
-; multiple x 2
-Print "Shift 1 bit left; Value = " + value Shl 1
-; multiple x 4
-Print "Shift 2 bits left; Value = " + value Shl 2
-; multiple x 16
-Print "Shift 4 bits left; Value = " + value Shl 4
-; divide by 2
-Print "Shift 1 bit right; Value = " + value Shr 1
-; divide by 4
-Print "Shift 2 bits right; Value = " + value Shr 2
-; divide by 16
-Print "Shift 4 bits right; Value = " + value Shr 4
-
-Print "Shift by SAR 4 times = " + value Sar 4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/ShowPointer.htm b/_release/help/commands/2d_commands/ShowPointer.htm
index f97de08..af5f3d5 100644
--- a/_release/help/commands/2d_commands/ShowPointer.htm
+++ b/_release/help/commands/2d_commands/ShowPointer.htm
@@ -1,47 +1,59 @@
-Command: ShowPointer
-
-
+Blitz3D Docs
+
-
-
-
ShowPointer
-
-
-Parameters:
-
-
-
-
n/a
-
-
-
Description:
-
-
-
-
ShowPointer is for use in windowed display modes, and simply shows the Windows pointer after it's been hidden (via HidePointer). It has no effect in full-screen modes.
-Graphics 640, 480, 0, 2
-
-HidePointer
-
-Print "Move pointer over window and press a key..."
-WaitKey
-
-ShowPointer
-
-Delay 1000
+
ShowPointer
+
Parameters
+
+
+
+None.
-
+
-
+
Description
+
+
+
+ShowPointer is for use in windowed display modes, and simply shows the Windows pointer after it's been hidden (via HidePointer). It has no effect in full-screen modes.
+
+
+See also: HidePointer.
+
+; HidePointer / ShoPointer Example
+
+; draw a simple screen, cut in half by a white line
+Graphics 800,600,0,2
+Color 255,255,255
+Line 400,0,400,600
+Text 200,300,"ShowPointer",True,True
+Text 600,300,"HidePointer",True,True
+
+; and a simple loop in which we hide / show the pointer dependent on
+; which side of the screen the mouse is on!
+Repeat
+ If MouseX()<400 Then
+ ShowPointer
+ Else
+ HidePointer
+ End If
+ If KeyHit(1) Then Exit ; ESCAPE to exit
+Forever
+
+End ; bye!
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Shr.htm b/_release/help/commands/2d_commands/Shr.htm
index fba9b53..5c66d4e 100644
--- a/_release/help/commands/2d_commands/Shr.htm
+++ b/_release/help/commands/2d_commands/Shr.htm
@@ -1,23 +1,58 @@
-Command: Shr Shr repetitions Definition:
Performs binary shift right.
Parameter Description:
repetitions = number of shifts to make right
Command Description:
This performs a left binary shift on the value the specified number of times. This basically is a faster method of dividing the value exponentially. By shifting right once, you are dividing the value by 2. By shifting right twice, you divide by 4, etc.
+
+
+Blitz3D Docs
+
+
+
+
Shr repetitions
+
Parameters
+
+
+
+repetitions = number of shifts to make right
+
+
+
+
Description
+
+
+
+This performs a left binary shift on the value the specified number of times. This basically is a faster method of dividing the value exponentially. By shifting right once, you are dividing the value by 2. By shifting right twice, you divide by 4, etc.
+
+The usefulness of this command is basically faster math execution.
+
+; shl, shr, sar examples
+
+value = 100
+
+; multiple x 2
+Print "Shift 1 bit left; Value = " + value Shl 1
+; multiple x 4
+Print "Shift 2 bits left; Value = " + value Shl 2
+; multiple x 16
+Print "Shift 4 bits left; Value = " + value Shl 4
+; divide by 2
+Print "Shift 1 bit right; Value = " + value Shr 1
+; divide by 4
+Print "Shift 2 bits right; Value = " + value Shr 2
+; divide by 16
+Print "Shift 4 bits right; Value = " + value Shr 4
+
+Print "Shift by SAR 4 times = " + value Sar 4
+
+WaitKey()
+
+
+
+
-The usefulness of this command is basically faster math execution.
-value = 100
-
-; multiple x 2
-Print "Shift 1 bit left; Value = " + value Shl 1
-; multiple x 4
-Print "Shift 2 bits left; Value = " + value Shl 2
-; multiple x 16
-Print "Shift 4 bits left; Value = " + value Shl 4
-; divide by 2
-Print "Shift 1 bit right; Value = " + value Shr 1
-; divide by 4
-Print "Shift 2 bits right; Value = " + value Shr 2
-; divide by 16
-Print "Shift 4 bits right; Value = " + value Shr 4
-
-Print "Shift by SAR 4 times = " + value Sar 4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Sin.htm b/_release/help/commands/2d_commands/Sin.htm
index 0805a6c..28c4e6d 100644
--- a/_release/help/commands/2d_commands/Sin.htm
+++ b/_release/help/commands/2d_commands/Sin.htm
@@ -1,26 +1,106 @@
-Command: Sin Sin (Number) Definition:
The Sin command, or Sinus, is a trigonometry function, that returns a number between -1 and 1. This value represents the "Y" coordinate of the point a
Parameter Description:
number=float or integer representing a value in degree
Command Description:
This command is used for translating angle values to coordinates, but there are a few things you have to take into account when doing it. First of all the Sin() command assumes the point you want is at radius 1 (pixel), next it uses a circle where 0 degrees is due EAST and increases in a counterclockwise direction, then you've got to take into account the the Y axis on a computer screen is up-side-down compared to a normal mathematical coordinate system.
+
+
+Blitz3D Docs
+
+
+
+
Sin# ( degrees# )
+
Parameters
+
+
+
+degrees# = angle in degrees.
+
+
+
+
Description
+
+
+
+Sine of an angle. The angle is measured in degrees.
+
+For angles between 0 and 90 degrees this is defined by the sides of a right triangle. The sine is the side opposite the angle divided by the hypotenuse.
+
+Outside of 0 to 90 the definition uses a circle with radius=1. The angle is placed at the center of the circle, with one side on the positive x-axis. The other side hits the circle at some point. The y coordinate of this point is the sine of the angle.
+
+The positive y-axis corresonds to +90 degrees. This is a common source of confusion in Blitz. With screen coordinates ( pixels ) the y-axis points downward. But in the 3d world the y-axis typically points upward.
+
+Another possible snag is the size of the angle. In principle, the sine function repeats every 360 degrees. So Sin(-360), Sin(0), Sin(360), Sin(720) etc. should all be exactly the same. But in practice the accuracy decreases as the angle gets farther away from zero.
+
+See also ASin, Cos, ACos, Tan, Atan, ATan2
+
Graphics 640,480; Change to graphics mode, nothing tricky yet.
-Origin 320,240 ; Move the point of orign for all drawing commands to the middle of the screen.
+Index
-For degrees=0 To 359; Step though all the degrees in a circle (360 in all)
-Delay(5); Wait 5 milli secsonds.
-
-; The next line calculates the Y coordinate of the point of the circle using the Sin
-; command, and multiplies it by 100 (to get a larger radius, try and change it).
-y=Sin(degrees)*100
-
-y=-y ; Invert Y coordinate to represent it properly on screen.
-
-; The next line calculates the X coordinate of the point of the circle using the Cos,
-; command, and multiplies it by 100 (to get a larger radius, try and change it).
-x=Cos(degrees)*100
-
-Rect x,y,1,1 ; Draw the current point on the circle.
-
-Next ; Give us another angle
-
-MouseWait ; Wait for the mouse.
-End ; Terminate the program.
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SoundPan.htm b/_release/help/commands/2d_commands/SoundPan.htm
index 02c85ba..81eb19a 100644
--- a/_release/help/commands/2d_commands/SoundPan.htm
+++ b/_release/help/commands/2d_commands/SoundPan.htm
@@ -1,11 +1,45 @@
-Command: SoundPan SoundPan sound_variable,pan# Definition:
Pans the sound effect right, center, or left.
Parameter Description:
sound_variable = any valid sound variable previously created with the LoadSound command.
-pan# = floating point number from -1 (left) to 0 (center) to 1 (right)
Command Description:
Use this command to pan your sound effect between the left and right speakers (or restore the panning to the center). Use this for cool panning stereo sounds during your game.
+sound_variable = any valid sound variable previously created with the LoadSound command.
+pan# = floating point number from -1 (left) to 0 (center) to 1 (right)
+
+
+
+
Description
+
+
+
+Use this command to pan your sound effect between the left and right speakers (or restore the panning to the center). Use this for cool panning stereo sounds during your game.
+
+; Load sound sample
+sndDeath=LoadSound("audiodeath.wav")
+
+; Pan sound effect half to the left
+SoundPan sndDeath,-.5
+
+; Play sound
+PlaySound sndDeath
+
+
+
+
-; Pan sound effect half to the left
-SoundPan sndDeath,-.5
+Index
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SoundPitch.htm b/_release/help/commands/2d_commands/SoundPitch.htm
index be29982..ba5b77c 100644
--- a/_release/help/commands/2d_commands/SoundPitch.htm
+++ b/_release/help/commands/2d_commands/SoundPitch.htm
@@ -1,18 +1,51 @@
-Command: SoundPitch SoundPitch sound_variable, hertz Definition:
Alter the pitch of a sound.
Parameter Description:
sound_variable = any valid sound variable previously created with the LoadSound command.
+
+
+Blitz3D Docs
+
+
+
+
SoundPitch sound_variable, hertz
+
Parameters
+
+
+
+sound_variable = any valid sound variable previously created with the LoadSound command.
+
+hertz = valid playback hertz speed (up to 44000 hertz).
+
+
+
+
Description
+
+
+
+Alters the pitch of a sound previously loaded with the LoadSound command. By changing the pitch, you can often reuse sounds for different uses or to simulate a 'counting up/down' sound. To make the sound 'higher pitched', increase the hertz. Conversely, decreasing the hertz will 'lower' the pitch. Note: this is in relation to the original hertz frequency of the sound.
+
+; Load the sound (11,000 hertz)
+
+snd1Up = LoadSound("audiooneup.wav")
+
+; Play the sound normally
+PlaySound snd1Up
+
+; Change the pitch UP and play it
+SoundPitch snd1Up, 11000*2 ;twice original frequency
+PlaySound snd1Up
+
+; Change the pitch down and play it
+SoundPitch snd1Up, 11000/2 ;1/2 original frequency
+PlaySound snd1Up
+
+
+
-hertz = valid playback hertz speed (up to 44000 hertz).
Command Description:
Alters the pitch of a sound previously loaded with the LoadSound command. By changing the pitch, you can often reuse sounds for different uses or to simulate a 'counting up/down' sound. To make the sound 'higher pitched', increase the hertz. Conversely, decreasing the hertz will 'lower' the pitch. Note: this is in relation to the original hertz of the sound.
-snd1Up = LoadSound("audio\oneup.wav")
-
-; Play the sound normally
-PlaySound snd1Up
-
-; Change the pitch UP and play it
-SoundPitch snd1Up, 22000
-PlaySound snd1Up
-
-; Change the pitch down and play it
-SoundPitch snd1Up, 8000
-PlaySound snd1Up
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SoundVolume.htm b/_release/help/commands/2d_commands/SoundVolume.htm
index a9d4ec2..166769a 100644
--- a/_release/help/commands/2d_commands/SoundVolume.htm
+++ b/_release/help/commands/2d_commands/SoundVolume.htm
@@ -1,13 +1,47 @@
-Command: SoundVolume SoundVolume sound_variable,volume# Definition:
Alter the volume level of a sound effect.
Parameter Description:
sound_variable = any valid sound variable previously created with the LoadSound command.
-volume# = floating point number from 0 (silence) to 1 (full volume)
Command Description:
Alter the playback volume of your sound effect with this command. This command uses a floating point number from 0 to 1 to control the volume level.
+
+
+Blitz3D Docs
+
+
+
+
SoundVolume sound_variable,volume#
+
Parameters
+
+
+
+sound_variable = any valid sound variable previously created with the LoadSound command.
+volume# = floating point number from 0 (silence) to 1 (full volume)
+
+
+
+
Description
+
+
+
+Alter the playback volume of your sound effect with this command. This command uses a floating point number from 0 to 1 to control the volume level.
+
+Please see ChannelVolume for more options!
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Sqr.htm b/_release/help/commands/2d_commands/Sqr.htm
index fdefd31..a8456bf 100644
--- a/_release/help/commands/2d_commands/Sqr.htm
+++ b/_release/help/commands/2d_commands/Sqr.htm
@@ -1,7 +1,42 @@
-Command: Sqr Sqr (float) Definition:
Returns the square root of a given value.
Parameter Description:
float = any floating point number (integers are converted on the fly)
Command Description:
This command will return the square root of a specified value. The value returned is a floating point number.
Example:
; sqr# example
+
+
+Blitz3D Docs
+
+
+
+
Sqr (float)
+
Parameters
+
+
+
+float = any floating point number (integers are converted on the fly)
+
+
+
+
Description
+
+
+
+This command will return the square root of a specified value. The value returned is a floating point number.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/StartNetGame.htm b/_release/help/commands/2d_commands/StartNetGame.htm
index eaf83bf..b2e431c 100644
--- a/_release/help/commands/2d_commands/StartNetGame.htm
+++ b/_release/help/commands/2d_commands/StartNetGame.htm
@@ -1,14 +1,49 @@
-Command: StartNetGame() StartNetGame() Definition:
Starts a network game.
Parameter Description:
None.
Command Description:
Displays a Windows dialog with option to join or start a new multiplayer network game, via modem, serial connection or TCP/IP (Internet).
+
+
+Blitz3D Docs
+
+
+
+
StartNetGame()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Displays a Windows dialog with option to join or start a new multiplayer network game, via modem, serial connection or TCP/IP (Internet).
+
+Note: This command must be started before any other network commands, otherwise they will fail.
+
+A return value of 0 indicates failure, 1 means a game was joined and 2 means a game was created and is being hosted on the local machine.
+
+newGame = StartNetGame()
+; Check the status of the new game.
+If newGame = 0 Then
+print "Could not start or join net game."
+ElseIf newGame = 1
+print "Successfully joined the network game."
+ElseIf newGame = 2
+print "A new network game was started."
+EndIf
+
+
+
+
-Note: This command must be started before any other network commands, otherwise they will fail.
+Index
-A return value of 0 indicates failure, 1 means a game was joined and 2 means a game was created and is being hosted on the local machine.
Example:
newGame = StartNetGame()
-; Check the status of the new game.
-If newGame = 0 Then
- print "Could not start or join net game."
-ElseIf newGame = 1
- print "Successfully joined the network game."
-ElseIf newGame = 2
- print "A new network game was started."
-EndIf
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Step.htm b/_release/help/commands/2d_commands/Step.htm
index 9b61d7b..4c14286 100644
--- a/_release/help/commands/2d_commands/Step.htm
+++ b/_release/help/commands/2d_commands/Step.htm
@@ -1,2 +1,43 @@
-Command: Step Step Definition:
Set an increment for the FOR ... NEXT loop.
Parameter Description:
None
Command Description:
Use this to tell your FOR ... NEXT loop to increment a certain value each pass through the loop. STEP 1 is assumed and need not be declared. STEP 2 would skip every other value, STEP 3 would skip every third value, etc.
+Use this to tell your FOR ... NEXT loop to increment a certain value each pass through the loop. STEP 1 is assumed and need not be declared. STEP 2 would skip every other value, STEP 3 would skip every third value, etc.
+
+
+See also: For, To, Each, Next, Exit, While, Repeat.
+
+; Print 1 through 100, by tens
+
+For t = 1 To 100 Step 10
+Print t
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Stop.htm b/_release/help/commands/2d_commands/Stop.htm
index c876987..1547f4d 100644
--- a/_release/help/commands/2d_commands/Stop.htm
+++ b/_release/help/commands/2d_commands/Stop.htm
@@ -1,4 +1,41 @@
-Command: Stop Stop Definition:
Halts program execution during debugging.
Parameter Description:
None
Command Description:
If running the program in debug mode, it this command halts the program and returns you to the editor where you can then step through your code, view variables, etc.
Example:
; Halt the program and go to the editor/debugger
+
+
+Blitz3D Docs
+
+
+
+
Stop
+
Parameters
+
+
+
+None
+
+
+
+
Description
+
+
+
+If running the program in debug mode, it this command halts the program and returns you to the editor where you can then step through your code, view variables, etc.
-Stop
+; Halt the program and go to the editor/debugger
+
+Stop
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/StopChannel.htm b/_release/help/commands/2d_commands/StopChannel.htm
index 5526407..6b90122 100644
--- a/_release/help/commands/2d_commands/StopChannel.htm
+++ b/_release/help/commands/2d_commands/StopChannel.htm
@@ -1,44 +1,78 @@
-Command: StopChannel StopChannel channel_handle Definition:
Stops a playing sound channel.
Parameter Description:
channel_handle = variable assigned to the channel when played
-
Command Description:
This command replaced StopSound in the latter versions of Blitz Basic.
+
+
+Blitz3D Docs
+
+
+
+
StopChannel channel_handle
+
Parameters
+
+
+
+channel_handle = variable assigned to the channel when played
+
+
+
+
Description
+
+
+
+This command replaced StopSound in the latter versions of Blitz Basic.
+
+Once you have a sound playing, and a channel variable attached to it, you use this command to stop the sound. This works for all sound channel types, including MP3, WAV, MIDI, and CD track playback.
+
+; Channel examples
+
+Print "Loading sound ..."
+; Load the sample - you'll need to point this to a sound on your computer
+; For best results, make it about 5-10 seconds...
+sndWave=LoadSound("level1.wav")
+; Prepare the sound for looping
+LoopSound sndWave
+
+chnWave=PlaySound(sndWave)
+
+Print "Playing sound for 2 seconds ..."
+Delay 2000
+
+Print "Pausing sound for 2 seconds ..."
+PauseChannel chnWave
+Delay 2000
+
+Print "Restarting sound ..."
+ResumeChannel chnWave
+Delay 2000
+
+Print "Changing Pitch of sound ..."
+;StopChannel chnWave
+ChannelPitch chnWave, 22000
+Delay 2000
+
+Print "Playing new pitched sound ..."
+Delay 2000
+
+Print "Left speaker only"
+ChannelPan chnWave,-1
+Delay 2000
+
+Print "Right speaker only"
+ChannelPan chnWave,1
+Delay 2000
+
+Print "All done!"
+StopChannel chnWave
+
+
+
+
-Once you have a sound playing, and a channel variable attached to it, you use this command to stop the sound. This works for all sound channel types, including MP3, WAV, MIDI, and CD track playback.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/StopNetGame.htm b/_release/help/commands/2d_commands/StopNetGame.htm
index eb9f712..1cf4324 100644
--- a/_release/help/commands/2d_commands/StopNetGame.htm
+++ b/_release/help/commands/2d_commands/StopNetGame.htm
@@ -1,15 +1,50 @@
-Command: StopNetGame StopNetGame Definition:
Stops a network game in progress.
Parameter Description:
None.
Command Description:
Use this command to terminate the network game currently in progress (started with the StartNetGame() command). If possible, the hosting session will transfer to another machine connected to the network game.
Example:
; stopNetGame() example
+
+
+Blitz3D Docs
+
+
+
+
StopNetGame
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Use this command to terminate the network game currently in progress (started with the StartNetGame() command). If possible, the hosting session will transfer to another machine connected to the network game.
+
+; stopNetGame() example
+
+newGame = StartNetGame()
+; Check the status of the new game.
+If newGame = 0 Then
+print "Could not start or join net game."
+ElseIf newGame = 1
+print "Successfully joined the network game."
+ElseIf newGame = 2
+print "A new network game was started."
+EndIf
+waitkey()
+StopNetGame()
+print "The Network game was stopped."
+
+
+
+
-newGame = StartNetGame()
-; Check the status of the new game.
-If newGame = 0 Then
-print "Could not start or join net game."
-ElseIf newGame = 1
-print "Successfully joined the network game."
-ElseIf newGame = 2
-print "A new network game was started."
-EndIf
-waitkey()
-StopNetGame()
-print "The Network game was stopped."
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Str.htm b/_release/help/commands/2d_commands/Str.htm
index f5c5d74..d984e4b 100644
--- a/_release/help/commands/2d_commands/Str.htm
+++ b/_release/help/commands/2d_commands/Str.htm
@@ -1,9 +1,43 @@
-Command: Str Str variable/value Definition:
Convert numeric value to a string value.
Parameter Description:
variable/value = numeric value or variable
Command Description:
Use this command to transform an numeric value to a string value for use with string commands. Blitz prints numeric values just fine, but should you want to do functions like LEFT$, you'll need to convert your numeric variable to a string variable. Note: during the conversion, all 6 decimal places will be represented on floating point number conversions.
Example:
; STR example
+
+
+Blitz3D Docs
+
+
+
+
Str variable/value
+
Parameters
+
+
+
+variable/value = numeric value or variable
+
+
+
+
Description
+
+
+
+Use this command to transform an numeric value to a string value for use with string commands. Blitz prints numeric values just fine, but should you want to do functions like LEFT$, you'll need to convert your numeric variable to a string variable. Note: during the conversion, all 6 decimal places will be represented on floating point number conversions.
+
+If you wish to convert from a string to a number, there is no equivalent Val command. Instead, simply assign the string variable into a numeric variable, and Blitz will implicitly convert it.
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/String.htm b/_release/help/commands/2d_commands/String.htm
index caa2107..ffe2240 100644
--- a/_release/help/commands/2d_commands/String.htm
+++ b/_release/help/commands/2d_commands/String.htm
@@ -1,6 +1,40 @@
-Command: String$ String$ (string$, integer) Definition:
Returns a designated string a designated number of times.
Parameter Description:
string$ = any valid string or string variable
-integer = the number of times to repeat the string
Command Description:
This makes a string filled with the specified occurances of the designated string. In other words, you could use this command to write the same string over and over again. See the example.
Example:
name$="Shane"
-' Write the name string 10 times
-Print String$(name$,10)
-
+string$ = any valid string or string variable
+integer = the number of times to repeat the string
+
+
+
+
Description
+
+
+
+This makes a string filled with the specified occurances of the designated string. In other words, you could use this command to write the same string over and over again. See the example.
+
+name$="Shane"
+' Write the name string 10 times
+Print String$(name$,10)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/StringHeight.htm b/_release/help/commands/2d_commands/StringHeight.htm
index 07051c4..e8fde11 100644
--- a/_release/help/commands/2d_commands/StringHeight.htm
+++ b/_release/help/commands/2d_commands/StringHeight.htm
@@ -1,8 +1,42 @@
-Command: StringHeight StringHeight (string) Definition:
Returns the height (in pixels) of a given string.
Parameter Description:
string = any valid string or string variable
Command Description:
This will return the size, in pixels, the height of the indicated string. This is useful for determining screen layout, scrolling of text, and more. This is calculated based on the size of the currently loaded font.
+This will return the size, in pixels, the height of the indicated string. This is useful for determining screen layout, scrolling of text, and more. This is calculated based on the size of the currently loaded font.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/StringWidth.htm b/_release/help/commands/2d_commands/StringWidth.htm
index 734e397..ff884fe 100644
--- a/_release/help/commands/2d_commands/StringWidth.htm
+++ b/_release/help/commands/2d_commands/StringWidth.htm
@@ -1,8 +1,42 @@
-Command: StringWidth StringWidth (string) Definition:
Returns the width (in pixels) of a given string.
Parameter Description:
string = any valid string or string variable
Command Description:
This will return the size, in pixels, the width of the indicated string. This is useful for determining screen layout, scrolling of text, and more. This is calculated based on the size of the currently loaded font.
+This will return the size, in pixels, the width of the indicated string. This is useful for determining screen layout, scrolling of text, and more. This is calculated based on the size of the currently loaded font.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/SystemProperty.htm b/_release/help/commands/2d_commands/SystemProperty.htm
index 8f776ed..9f030fa 100644
--- a/_release/help/commands/2d_commands/SystemProperty.htm
+++ b/_release/help/commands/2d_commands/SystemProperty.htm
@@ -1,49 +1,57 @@
-Command: SystemProperty
-
-
+Blitz3D Docs
+
-
-
-
SystemProperty
-
-
-Parameters:
-
-
-
-
property$ - system property information required (valid strings listed below)
-
-
-
Description:
-
-
-
-
SystemProperty () returns the location of a standard system folder, which can be different on every computer. Note that it's not a good idea to play around in a user's Windows or System folder!
-
-Valid parameters are:
-
-"tempdir" - Temp folder
-"systemdir" - System folder
-"windowsdir" - Windows folder
-"appdir" - Program Files folder
+
SystemProperty (property$)
+
Parameters
+
+
+
+property$ - system property information required (valid strings listed below)
+SystemProperty is used to 'find out' certain system-specific things that are external to the currently running program.
+
+There are broadly two different uses for SystemProperty, one for finding out the location of certain folders on the Windows OS, and one for finding out the handles/objects being used by the Win32/DX APIs to run Blitz programs. These objects and handles can then be used via third party DLLs to add extra functionality to Blitz, although this is recommended for advanced users only.
+
+Properties - folders:
+
+systemdir - System folder
+windowsdir - Windows folder
+tempdir - Temp folder
+appdir - Program Files folder
+
+Properties - objects/handles:
+
+Direct3D7
+Direct3DDevice7
+DirectDraw7
+DirectInput7
+AppHWND
+AppHINSTANCE
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/TCPTimeOuts.htm b/_release/help/commands/2d_commands/TCPTimeOuts.htm
index 76c6b18..7a9c9a6 100644
--- a/_release/help/commands/2d_commands/TCPTimeOuts.htm
+++ b/_release/help/commands/2d_commands/TCPTimeOuts.htm
@@ -1,68 +1,40 @@
-Command: TCPTimeOuts
-
-
+Blitz3D Docs
+
-
+
TCPTimeouts read_millis,accept_millis
+
Parameters
+
+
+
+read_millis - milliseconds value
+accept_millis - milliseconds value
+
+
+
+
Description
+
+
+
+read_millis allows you to control how long reading data into a TCP stream can take before causing an error. By default, this is set to 10,000 (10 seconds). This means that if data takes longer than 10 seconds to arrive, an error occurs and the stream can not be used any more.
+
+accept_millis allows you to control how the AcceptTCPStream() function will wait for a new connection. By default, this value is 0, so AcceptTCPStream() will return immediately if there is no new connection available.
+
-read_millis -- timeout if TCP read commands cause no response within specified time (in milliseconds)
-write_millis -- timeout if TCP write commands cause no response within specified time (in milliseconds)
-accept_millis -- timeout if TCP accept commands cause no response within specified time (in milliseconds)
-
+
-
Description:
-
-
-
-
TCPTimeOuts () affects all future calls to the TCP stream functions. You specify the number of milliseconds after which the given timeout should activate; one setting for timeouts when reading from a TCP stream, one for writing to a TCP stream and one for acceptance of a TCP stream (effectively, a server's response time).
-
-; To cause an error if no connection is received by a server within 3 seconds:
-
-TCPTimeouts 0, 0, 5000 ; 5 second 'accept_millis' parameter
-
-AppTitle "Impatient Server (tm)"
-
-Graphics 640, 480
-SetBuffer BackBuffer ()
-Text 10, 10, "Accepting incoming data received within 5 seconds..."
-Flip
-
-server = CreateTCPServer (8080)
-
-If server
- If AcceptTCPStream (server)
- Text 10, 30, "Incoming data! Eek!"
- Else
- Text 10, 50, "Accept timeout activated -- I'm outta here..."
- EndIf
- CloseTCPServer server
-EndIf
-
-Flip
-
-MouseWait
-End
-
-
-
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/TFormFilter.htm b/_release/help/commands/2d_commands/TFormFilter.htm
index e697c50..9bcfbd0 100644
--- a/_release/help/commands/2d_commands/TFormFilter.htm
+++ b/_release/help/commands/2d_commands/TFormFilter.htm
@@ -1,33 +1,68 @@
-Command: TFormFilter TFormFilter enable Definition:
Toggles bilinear filtering on convoluted images.
Parameter Description:
enable = 0 to turn off filtering; 1 to turn it on
Command Description:
This command will enable or disable bi-linear filtering on images that are convoluted (altered) by commands like TFormImage and RotateImage.
+
+
+Blitz3D Docs
+
+
+
+
TFormFilter enable
+
Parameters
+
+
+
+enable = 0 to turn off filtering; 1 to turn it on
+
+
+
+
Description
+
+
+
+This command will enable or disable bi-linear filtering on images that are convoluted (altered) by commands like TFormImage and RotateImage.
+
+This filtering allows the convoluted graphics to have smoother, more aliased edges. This also makes the operations slower. The bi-linear filtering can also create non-transparent edges what will mess with your transparency. Experiment for the best results.
+
+Try changing the example to see the difference.
+
+; RotateImage/TFormFilter Example
+
+; Turn on graphics mode
+Graphics 640,480,16
+
+; Remove the line below to see the difference
+; between filter on and off.
+TFormFilter 0
+
+; Create new empty graphic to store our circle in
+gfxBox=CreateImage(50,50)
+
+; Draw the box image
+; Set drawing operations to point to our new empty graphic
+SetBuffer ImageBuffer(gfxBox)
+Color 255,0,0
+; Note the extra space between the box and the edge of the graphic
+Rect 10,10,30,30,1
+SetBuffer FrontBuffer()
+
+While Not KeyHit(1)
+; Make a copy of the image so we are always using a fresh one each time
+; we rotate it.
+gfxTemp=CopyImage(gfxBox)
+; Rotate it a random value and draw it at a random location
+RotateImage gfxTemp,Rnd(360)
+DrawImage gfxTemp,Rnd(640),Rnd(480)
+Wend
+
+
+
+
-This filtering allows the convoluted graphics to have smoother, more aliased edges. This also makes the operations slower. The bi-linear filtering can also create non-transparent edges what will mess with your transparency. Experiment for the best results.
+Index
-Try changing the example to see the difference.
Example:
; RotateImage/TFormFilter Example
-
-; Turn on graphics mode
-Graphics 640,480,16
-
-; Remove the line below to see the difference
-; between filter on and off.
-TFormFilter 0
-
-; Create new empty graphic to store our circle in
-gfxBox=CreateImage(50,50)
-
-; Draw the box image
-; Set drawing operations to point to our new empty graphic
-SetBuffer ImageBuffer(gfxBox)
-Color 255,0,0
-; Note the extra space between the box and the edge of the graphic
-Rect 10,10,30,30,1
-SetBuffer FrontBuffer()
-
-While Not KeyHit(1)
-; Make a copy of the image so we are always using a fresh one each time
-; we rotate it.
-gfxTemp=CopyImage(gfxBox)
-; Rotate it a random value and draw it at a random location
-RotateImage gfxTemp,Rnd(360)
-DrawImage gfxTemp,Rnd(640),Rnd(480)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Tan.htm b/_release/help/commands/2d_commands/Tan.htm
index 0a231d2..4b084b5 100644
--- a/_release/help/commands/2d_commands/Tan.htm
+++ b/_release/help/commands/2d_commands/Tan.htm
@@ -1,11 +1,104 @@
-Command: Tan Tan (number) Definition:
Returns the tangent of an angle.
Parameter Description:
number=float or integer representing a value in degrees
Command Description:
Tan takes an angle and returns the ratio of two sides of a right triangle. The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle.
+
+
+Blitz3D Docs
+
+
+
+
Tan# ( degrees# )
+
Parameters
+
+
+
+degrees# = angle in degrees.
+
+
+
+
Description
+
+
+
+Tangent of an angle. The angle is measured in degrees.
+
+For angles between 0 and 90 degrees this is defined by the sides of a right triangle. The tangent is the side opposite the angle divided by the side adjacent to the angle.
+
+In general, tangent is defined as sine divided by cosine.
+
+The positive y-axis corresonds to +90 degrees. This is a common source of confusion in Blitz. With screen coordinates ( pixels ) the y-axis points downward. But in the 3d world the y-axis typically points upward.
+
+Another possible snag is the size of the angle. In principle, the tangent function repeats every 180 degrees. So Tan(-180), Tan(0), Tan(180), Tan(360) etc. should all be exactly the same. But in practice the accuracy decreases as the angle gets farther away from zero.
+
+; Sin / Cos / Tan example.
+
+; Left/Right arrow keys change angle. Escape quits.
+
+Const width = 640, height = 480
+Const radius# = .2 * height
+Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205
+
+Graphics width, height
+SetBuffer BackBuffer( )
+Origin width / 3, height / 2
+
+angle# = 0.0
+
+While Not KeyDown( KEY_ESC )
+
+; NOTE: It is usually best to avoid very large angles.
+; The 'If angle...' lines show one way to do this.
+; Mod is another possibility.
+
+If KeyDown( KEY_LEFT ) Then angle = angle - .5
+; If angle < 0.0 Then angle = angle + 360
+
+If KeyDown( KEY_RIGHT ) Then angle = angle + .5
+; If angle >= 360.0 Then angle = angle - 360
+
+Cls
+
+Color 80, 80, 0 ; pale yellow circle
+Oval -radius, -radius, 2 * radius, 2 * radius, False
+
+For a# = 0.0 To Abs( angle Mod 360 ) Step .5
+
+x# = radius * Cos( a ) ; (x,y) is a point on the circle
+y# = radius * Sin( a ) ; corresponding to angle a.
+
+If ( angle Mod 360 < 0 ) Then y = -y ; reverse for negative angle
+WritePixel x, y, $ffff00 ; bright yellow
+
+Next
+
+Color 255, 255, 0 ; yellow
+Line 0, 0, radius * Cos( angle ), radius * Sin( angle )
+
+Color 0, 255, 0 ; green
+Line 0, 0, radius * Cos( angle ), 0
+Text radius * 1.5, 10, "Cos( angle ) = " + Cos( angle )
+
+Color 255, 0, 0 ; red
+Line radius * Cos( angle ), 0, radius * Cos( angle ), radius * Sin( angle )
+Text radius * 1.5, -10, "Sin( angle ) = " + Sin( angle )
+
+Color 255, 255, 255
+Text radius * 1.5, -30, " angle = " + angle
+Text radius * 1.5, 30, "Tan( angle ) = " + Tan( angle )
+
+Flip
+
+Wend
+
+End
+
+
+
-This is useful for artillery sort of games where your bullets will fire from a barrel at a certain angle. You can use the Tan value in your power/angle formula to help determine the trajectory of the shot.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Text.htm b/_release/help/commands/2d_commands/Text.htm
index 05ecbe0..011ebdc 100644
--- a/_release/help/commands/2d_commands/Text.htm
+++ b/_release/help/commands/2d_commands/Text.htm
@@ -1,17 +1,52 @@
-Command: Text Text x,y,string$,[center x],[center y] Definition:
Print text to the graphic screen at the designated coordinates.
Parameter Description:
x = starting x coordinate to print text
-y = starting 4 coordinate to print text
-string$ = string/text to print
-center x = optional; true = center horizontally
-center y = optional; true = center vertically
Command Description:
Prints a string at the designated screen coordinates. You can center the text on the coordiates by setting center x/center y to TRUE. This draws the text in the current drawing color.
+
+
+Blitz3D Docs
+
+
+
+
Text x,y,string$,[center x],[center y]
+
Parameters
+
+
+
+x = starting x coordinate to print text
+y = starting 4 coordinate to print text
+string$ = string/text to print
+center x = optional; true = center horizontally
+center y = optional; true = center vertically
+
+
+
+
Description
+
+
+
+Prints a string at the designated screen coordinates. You can center the text on the coordiates by setting center x/center y to TRUE. This draws the text in the current drawing color.
+
+Note: Printing a space with text will NOT render a block - a space is an empty value. So printing " " will not make a box appear.
+
+; Text example
+
+; enable graphics mode
+Graphics 800,600,16
+
+; wait for ESC key before ending
+While Not KeyHit(1)
+;print the text, centered horizontally at x=400, y=0
+Text 400,0,"Hello There!",True,False
+Wend
+
+
+
+
-Note: Printing a space with text will NOT render a block - a space is an empty value. So printing " " will not make a box appear.
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Then.htm b/_release/help/commands/2d_commands/Then.htm
index 2aef01b..fc32de3 100644
--- a/_release/help/commands/2d_commands/Then.htm
+++ b/_release/help/commands/2d_commands/Then.htm
@@ -1,18 +1,54 @@
-Command: Then Then Definition:
Part of the IF conditional structure
Parameter Description:
None.
Command Description:
Used in an IF statement to denote the end of the conditional to be checked. Famous for its participation in the IF ... THEN structure. See example and IF statement for more information.
Example:
; IF THEN Example
+
+
+Blitz3D Docs
+
+
+
+
Then
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Used in an IF statement to denote the end of the conditional to be checked. Famous for its participation in the IF ... THEN structure. See example and IF statement for more information.
-; Input the user's name
-name$=Input$("What is your name? ")
-; Doesn't the person's name equal SHANE?
-If name$ = "Shane" Then
+See also: If, Else, ElseIf, EndIf, Select.
+
+; IF THEN Example
+
+; Input the user's name
+name$=Input$("What is your name? ")
+
+; Doesn't the person's name equal SHANE?
+If name$ = "Shane" Then
+
+ Print "You are recognized, Shane! Welcome!"
+
+Else
+
+ Print "Sorry, you don't belong here!"
+
+; End of the condition checking
+End If
+
+
+
-Print "You are recognized, Shane! Welcome!"
+Index
-Else
-
-Print "Sorry, you don't belong here!"
-
-; End of the condition checking
-End If
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/TileBlock.htm b/_release/help/commands/2d_commands/TileBlock.htm
index db22a97..4db92bc 100644
--- a/_release/help/commands/2d_commands/TileBlock.htm
+++ b/_release/help/commands/2d_commands/TileBlock.htm
@@ -1,16 +1,51 @@
-Command: TileBlock TileBlock image [,x,y,frame] Definition:
Tile an image without transparency.
Parameter Description:
image = file handle variable holding the loaded image
-x = x coordinate offset(optional)
-y = y coordinate offset (optional)
-frame = frame of the image to use (optional)
Command Description:
Similar to TileImage but ignores transparency. Use this to tile an entire or portion of the screen with a single repetative image.
+image = file handle variable holding the loaded image
+x = x coordinate offset(optional)
+y = y coordinate offset (optional)
+frame = frame of the image to use (optional)
+
+
+
+
Description
+
+
+
+Similar to TileImage but ignores transparency. Use this to tile an entire or portion of the screen with a single repetative image.
+
+; TileBlock example
+Graphics 800,600,16
+
+; Load an image to tile (your location might vary)
+gfxBall=LoadImage("C:Program FilesBlitz Basicsamplesall.bmp")
+
+; Tile the graphic without transparency
+TileBlock gfxBall
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+Wend
+
+
+
+
-; Load an image to tile (your location might vary)
-gfxBall=LoadImage("C:\Program Files\Blitz Basic\samples\ball.bmp")
+Index
-; Tile the graphic without transparency
-TileBlock gfxBall
-
-; Wait for ESC to hit
-While Not KeyHit(1)
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/TileImage.htm b/_release/help/commands/2d_commands/TileImage.htm
index c7aa297..a3aafdb 100644
--- a/_release/help/commands/2d_commands/TileImage.htm
+++ b/_release/help/commands/2d_commands/TileImage.htm
@@ -1,44 +1,79 @@
-Command: TileImage TileImage handle,[x],[y],[frames] Definition:
Tiles the screen with an image (or its frames) of your choice.
Parameter Description:
handle= variable holding the image's handle
-x=starting x location of the tile; assumed 0
-y=starting y location of the tile; assumed 0
-frames=the frame of the image to tile; optional with imagestrip
Command Description:
If you want to make a starfield or other easy tiled background, this is YOUR command. All you have to do is specify the image handle (an image loaded with the LoadImage or LoadAnimImage command). Optionally, you can specify a starting x and y location, as well as an optional frame. You can milk some serious parallax effects with a simple imagestrip with a couple of various starfields and the TileImage command.
+handle= variable holding the image's handle
+x=starting x location of the tile; assumed 0
+y=starting y location of the tile; assumed 0
+frames=the frame of the image to tile; optional with imagestrip
+
+
+
+
Description
+
+
+
+If you want to make a starfield or other easy tiled background, this is YOUR command. All you have to do is specify the image handle (an image loaded with the LoadImage or LoadAnimImage command). Optionally, you can specify a starting x and y location, as well as an optional frame. You can milk some serious parallax effects with a simple imagestrip with a couple of various starfields and the TileImage command.
+
+; CreateImage/TileImage/ImageBuffer example
+
+; Again, we'll use globals even tho we don't need them here
+; One variable for the graphic we'll create, one for a timer
+Global gfxStarfield, tmrScreen
+
+; Declare graphic mode
+Graphics 640,480,16
+
+; Create a blank image that is 320 pixels wide and 32 high with 10 frames of 32x32
+gfxStarfield=CreateImage(32,32,10)
+
+; loop through each frame of the graphic we just made
+For t = 0 To 9
+; Set the drawing buffer to the graphic frame so we can write on it
+SetBuffer ImageBuffer(gfxStarfield,t)
+; put 50 stars in the frame at random locations
+For y = 1 To 50
+Plot Rnd(32),Rnd(32)
+Next
+Next
+
+; Double buffer mode for smooth screen drawing
+SetBuffer BackBuffer()
+
+; Loop until ESC is pressed
+While Not KeyHit(1)
+
+; Only update the screen every 300 milliseconds. Change 300 for faster or
+; slower screen updates
+If MilliSecs() > tmrScreen+300 Then
+Cls ; clear the screen
+
+; Tile the screen with a random frame from our new graphic starting at
+; x=0 and y=0 location.
+TileImage gfxStarfield,0,0,Rnd(9)
+Flip ; Flip the screen into view
+tmrScreen=MilliSecs() ; reset the time
+End If
+Wend
+
+
+
+
-; Again, we'll use globals even tho we don't need them here
-; One variable for the graphic we'll create, one for a timer
-Global gfxStarfield, tmrScreen
+Index
-; Declare graphic mode
-Graphics 640,480,16
-
-; Create a blank image that is 320 pixels wide and 32 high with 10 frames of 32x32
-gfxStarfield=CreateImage(32,32,10)
-
-; loop through each frame of the graphic we just made
-For t = 0 To 9
-; Set the drawing buffer to the graphic frame so we can write on it
-SetBuffer ImageBuffer(gfxStarfield,t)
-; put 50 stars in the frame at random locations
-For y = 1 To 50
- Plot Rnd(32),Rnd(32)
-Next
-Next
-
-; Double buffer mode for smooth screen drawing
-SetBuffer BackBuffer()
-
-; Loop until ESC is pressed
-While Not KeyHit(1)
-
-; Only update the screen every 300 milliseconds. Change 300 for faster or
-; slower screen updates
-If MilliSecs() > tmrScreen+300 Then
-Cls ; clear the screen
-
-; Tile the screen with a random frame from our new graphic starting at
-; x=0 and y=0 location.
-TileImage gfxStarfield,0,0,Rnd(9)
-Flip ; Flip the screen into view
-tmrScreen=MilliSecs() ; reset the time
-End If
-Wend
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/To.htm b/_release/help/commands/2d_commands/To.htm
index 4a46fa4..56503a4 100644
--- a/_release/help/commands/2d_commands/To.htm
+++ b/_release/help/commands/2d_commands/To.htm
@@ -1,2 +1,43 @@
-Command: To To Definition:
Dictates the range of values for a FOR ... NEXT loop.
Parameter Description:
See example
Command Description:
Use the TO command to tell your FOR ... NEXT loop which numbers the variable should be assign to during the loop. If you count down instead of up, you must use a negative STEP value. The values must be integer values. See example.
+Use the TO command to tell your FOR ... NEXT loop which numbers the variable should be assign to during the loop. If you count down instead of up, you must use a negative STEP value. The values must be integer values. See example.
+
+
+See also: For, To, Step, Each, Next, Exit, While, Repeat.
+
+; Print numbers 10 to 1
+
+For t = 10 to 1 Step -1
+Print t
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/TotalVidMem.htm b/_release/help/commands/2d_commands/TotalVidMem.htm
index 78e2726..0e66669 100644
--- a/_release/help/commands/2d_commands/TotalVidMem.htm
+++ b/_release/help/commands/2d_commands/TotalVidMem.htm
@@ -1,39 +1,37 @@
-Command: TotalVidMem
-
-
+Blitz3D Docs
+
-
-
-
TotalVidMem
-
-
-Parameters:
-
-
-
-
n/a
-
-
-
Description:
-
-
-
-
TotalVidMem () simply returns the total available memory on a graphics card, in bytes. Note that to retrieve the currently available number of bytes, you should use AvailVidMem ().
+
-Print "Total graphics memory available: " + TotalVidMem () + " bytes."
-; NOTE: To retrieve the *available* graphics memory, use AvailVidMem ()!
-
+
Description
+
+
+
+TotalVidMem () simply returns the total available memory on a graphics card, in bytes. Note that to retrieve the currently available number of bytes, you should use AvailVidMem ().
+
+Print "Total graphics memory available: " + TotalVidMem () + " bytes."
+; NOTE: To retrieve the *available* graphics memory, use AvailVidMem ()!
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Trim.htm b/_release/help/commands/2d_commands/Trim.htm
index b0f48b7..4adb871 100644
--- a/_release/help/commands/2d_commands/Trim.htm
+++ b/_release/help/commands/2d_commands/Trim.htm
@@ -1,5 +1,43 @@
-Command: Trim$ Trim$ (string$) Definition:
Removes leading and trailing spaces from a string.
Parameter Description:
string$ = any valid string or string variable
Command Description:
Use this command to remove that nasty space at the beginning and ending of a string.
Example:
name$=" Shane R. Monroe "
-Print "Your name before trimming is: '" + name$ "' ..."
-Print "Your name trimmed is: '" + Trim$(name$) + "' ..."
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/True.htm b/_release/help/commands/2d_commands/True.htm
index 02be6eb..26f4ce5 100644
--- a/_release/help/commands/2d_commands/True.htm
+++ b/_release/help/commands/2d_commands/True.htm
@@ -1,19 +1,55 @@
-Command: True True Definition:
A boolean expression used in comparisons. Actually returns a value of 1.
Parameter Description:
None.
Command Description:
TRUE is a keyword to denote a positive result in a conditional statement. Often times, TRUE is implied and doesn't need to be directly referenced. TRUE can also be used as a RETURN value from a FUNCTION. See the example.
Example:
; TRUE example
+
+
+Blitz3D Docs
+
+
+
+
True
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+TRUE is a keyword to denote a positive result in a conditional statement. Often times, TRUE is implied and doesn't need to be directly referenced. TRUE can also be used as a RETURN value from aFUNCTION. See the example.
-; Assign test a random number of 0 or 1
-test= Rnd(0,1)
-; TRUE is implied; This statement REALLY means: if test=1 is TRUE then proceed
-If test=1 Then
-Print "Test was valued at 1"
-End If
+See also: False, If, Select, While, Repeat.
+
+; TRUE example
+
+; Assign test a random number of 0 or 1
+test= Rnd(0,1)
+
+; TRUE is implied; This statement REALLY means: if test=1 is TRUE then proceed
+If test=1 Then
+Print "Test was valued at 1"
+End If
+
+; Let's set test to be true
+test=True
+
+; Pointlessly test it
+If test=True Then
+Print "Test is true"
+End If
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Type.htm b/_release/help/commands/2d_commands/Type.htm
index 79321a9..246d875 100644
--- a/_release/help/commands/2d_commands/Type.htm
+++ b/_release/help/commands/2d_commands/Type.htm
@@ -1,83 +1,80 @@
-Command: Type Type variable Definition:
Define an object with a collection of variables.
Parameter Description:
variable = any legal variable name
Command Description:
If you know C prgramming, a TYPE is basically a STRUCT in Blitz Basic. If you
- don't know C, read on!
-
TYPE is your best friend. It is used to create a 'collection' of objects that
- share the same parameters and need to be interated through quickly and easily.
-
Think about SPACE INVADERS. There are many aliens on the screen at one time.
- Each of these aliens have a few variables that they all need: x and y coordinates
- plus a variable to control which graphic to display (legs out or legs in). Now,
- we could make hundreds of variables like invader1x, invader1y, invader2x, invader2y,
- etc. to control all the aliens, but that wouldn't make much sense would it?
- You could use an array to track them; invader(number,x,y,graphic), and the loop
- through them with a FOR
- ... NEXT
- loop but that is a lot of work! The TYPE variable collection was created to
- handle just this sort of need.
-
TYPE defines an object collection. Each object in that collection inherits
- its own copy of the variables defined by the TYPE's FIELD
- command. Each variable of each object in the collection can be read individually
- and can be easily iterated through quickly. Use the FIELD command to assign
- the variables you want between the TYPE and END
- TYPE commands.
-
If it helps, think of a TYPE collection as a database. Each object is a record
- of the database, and every variable is a field of the record. Using commands
- like BEFORE,
- AFTER,
- and FOR ... EACH,
- you can move change the pointer of the 'database' to point to a different record
- and retrieve/set the variable 'field' values.
-
Not a database guru? Need another example? Okay. Let's say you are setting
- up an auditorium for a speech or event and you are putting up hundreds of chairs
- for the spectators. The chairs have to be in a certain place on the floor, and
- some will need to be raised up a bit higher than others (visiting dignitaries,
- the mayor is coming, etc.). So being the computer genius you are, you start
- figuring out how you can layout the chairs with the least amount of effort.
- You realize that the floor is checkered, so its really a huge grid! This will
- make it easy! You just need to number the floor on a piece of graph paper and
- put into the grid how high each chair should be, based on where the boss told
- you the important people are to sit. So, for each chair, you will have a row
- and column on the graph paper (x and y location) and a level to adjust the chair
- to (height). Good, we are organized. Now, even though we have it all on paper,
- we still have to do the work of placing all the chairs. After you are done,
- let's say your boss walks up to you and says "they aren't centered right
- .. move'em all over 1 square". Ah crap! You have them all perfect, and
- even though it is a simple thing to move a chair one square to the right (after
- all, their order and height won't change) - you still have to move each and
- every chair! Should would be nice if you could just wave your hand and say "For
- each chair in the room, add 1 square to its x location" and have it just
- magically happen. Alas, in the real world, get busy - you've got a lot of chairs
- to move!
-
In Blitz, you could have set up a TYPE called CHAIR, set the TYPE's FIELDS
- as X, Y, and HEIGHT. You would then create as many chairs as you need with the
- NEW
- command (each time you call NEW, it makes a new chair, with its OWN X, Y, and
- HEIGHT variables) and assign them the X, Y, and HEIGHT values you decide upon.
- In our example above, when the boss told you to move the chairs over 1 box,
- you probably groaned inside. That's a lot of work! In Blitz, we could use four
- lines of code to adjust all our CHAIR objects to the new position (using FOR
- ... EACH commands).
-
Still lost? Its okay - TYPEs are hard to get a grasp on. Look at the example
- and we'll try to show you how types work in a practical environment. I recommend
- looking at other people's code too, to help you get a handle on them. Once you
- do, you will know why C people are crazy for STRUCTs and why almost all Blitz
- programs use them.
Example:
; Define the CHAIR Type
-
- Type CHAIR
- Field X
- Field Y
- Field HEIGHT
- End Type
-
; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
-
For tempx = 1 to 10
- For tempy = 1 to 10
- room.chair = New Chair
- room\x = tempx
- room\y = tempy
- room\height = Rnd(0,10) ; set a random height 0 to 10
- Next
- Next
-
; Move them all over 1 (like the description example)
-
For room.chair = Each chair
- room\x = room\x + 1
- Next
+If you know C programming, a TYPE is basically a STRUCT in Blitz Basic. If you don't know C, read on!
+
+TYPE is your best friend. It is used to create a 'collection' of objects that share the same parameters and need to be interated through quickly and easily.
+
+Think about SPACE INVADERS. There are many aliens on the screen at one time. Each of these aliens have a few variables that they all need: x and y coordinates plus a variable to control which graphic to display (legs out or legs in). Now, we could make hundreds of variables like invader1x, invader1y, invader2x, invader2y, etc. to control all the aliens, but that wouldn't make much sense would it? You could use an array to track them; invader(number,x,y,graphic), and the loop through them with a FOR ... NEXT loop but that is a lot of work! The TYPE variable collection was created to handle just this sort of need.
+
+TYPE defines an object collection. Each object in that collection inherits its own copy of the variables defined by the TYPE's FIELD command. Each variable of each object in the collection can be read individually and can be easily iterated through quickly. Use the FIELD command to assign the variables you want between the TYPE and END TYPE commands.
+
+If it helps, think of a TYPE collection as a database. Each object is a record of the database, and every variable is a field of the record. Using commands like BEFORE, AFTER, and FOR ... EACH, you can move change the pointer of the 'database' to point to a different record and retrieve/set the variable 'field' values.
+
+Not a database guru? Need another example? Okay. Let's say you are setting up an auditorium for a speech or event and you are putting up hundreds of chairs for the spectators. The chairs have to be in a certain place on the floor, and some will need to be raised up a bit higher than others (visiting dignitaries, the mayor is coming, etc.). So being the computer genius you are, you start figuring out how you can layout the chairs with the least amount of effort. You realize that the floor is checkered, so its really a huge grid! This will make it easy! You just need to number the floor on a piece of graph paper and put into the grid how high each chair should be, based on where the boss told you the important people are to sit. So, for each chair, you will have a row and column on the graph paper (x and y location) and a level to adjust the chair to (height). Good, we are organized. Now, even though we have it all on paper, we still have to do the work of placing all the chairs. After you are done, let's say your boss walks up to you and says "they aren't centered right .. move'em all over 1 square". Oh no! You have them all perfect, and even though it is a simple thing to move a chair one square to the right (after all, their order and height won't change) - you still have to move each and every chair! Sure would be nice if you could just wave your hand and say "For each chair in the room, add 1 square to its x location" and have it just magically happen. Alas, in the real world, get busy - you've got a lot of chairs to move!
+
+In Blitz, you could have set up a TYPE called CHAIR, set the TYPE's FIELDS as X, Y, and HEIGHT. You would then create as many chairs as you need with the NEW command (each time you call NEW, it makes a new chair, with its OWN X, Y, and HEIGHT variables) and assign them the X, Y, and HEIGHT values you decide upon. In our example above, when the boss told you to move the chairs over 1 box, you probably groaned inside. That's a lot of work! In Blitz, we could use four lines of code to adjust all our CHAIR objects to the new position (using FOR ... EACH commands).
+
+Still lost? Its okay - TYPEs are hard to get a grasp on. Look at the example and we'll try to show you how types work in a practical environment. I recommend looking at other people's code too, to help you get a handle on them. Once you do, you will know why C people are crazy for STRUCTs and why almost all Blitz programs use them.
+
+A cunning trick for debug purposes, or for saving data from types to a file, is to use the Str$ command. Print Str$() will print the values of each field of the type in turn, comma separated, within square brackets, e.g. [15,42,"Fluffy",500].
+
+Advanced programmers might like to know that Types are stored in a "doubly linked list".
+
+
+See also: Field, New, Null, First, Last, Before, After, Insert, Before.
+
+; Define the CHAIR Type
+
+Type CHAIR
+Field X
+Field Y
+Field HEIGHT
+End Type
+
+; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
+
+For tempx = 1 to 10
+For tempy = 1 to 10
+room.chair = New Chair
+room\x = tempx
+room\y = tempy
+room\height = Rnd(0,10) ; set a random height 0 to 10
+Next
+Next
+
+; Move them all over 1 (like the description example)
+
+For room.chair = Each chair
+room\x = room\x + 1
+Next
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/UnlockBuffer.htm b/_release/help/commands/2d_commands/UnlockBuffer.htm
index 1eb27af..79f6e54 100644
--- a/_release/help/commands/2d_commands/UnlockBuffer.htm
+++ b/_release/help/commands/2d_commands/UnlockBuffer.htm
@@ -1,36 +1,73 @@
-Command: UnlockBuffer UnlockBuffer buffer Definition:
Unlocks the buffer previously locked for high speed pixel operations.
Parameter Description:
buffer = any valid screen/image buffer (optional)
Command Description:
After you use LockBuffer on a buffer, the only graphics commands you can use are the read/write pixel commands ReadPixel, WritePixel, ReadPixelFast, and WritePixelFast. You must use this command before using other graphics commands.
+
+
+Blitz3D Docs
+
+
+
+
UnlockBuffer buffer
+
Parameters
+
+
+
+buffer = any valid screen/image buffer (optional)
+
+
+
+
Description
+
+
+
+After you use LockBuffer on a buffer, the only graphics commands you can use are the read/write pixel commands ReadPixel, WritePixel, ReadPixelFast, and WritePixelFast. You must use this command before using other graphics commands.
+
+The buffer parameter isn't required. If omitted, the default buffer set with SetBuffer will be used.
+
+See the other commands for more information.
-The buffer parameter isn't required. If omitted, the default buffer set with SetBuffer will be used.
+; High Speed Graphics Commands
+
+Graphics 640,480,16
+
+; Draw a bunch of stuff on the screen
+For t= 1 To 1000
+Color Rnd(255),Rnd(255),Rnd(255)
+Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
+Next
+
+Delay 3000
+
+; Copy the top half of the screen over the bottom half
+; using fast pixels and locked buffers
+For x = 1 To 640
+For y = 1 To 240
+LockBuffer FrontBuffer()
+WritePixelFast x,y+241,ReadPixelFast(x,y)
+UnlockBuffer FrontBuffer()
+Next
+Next
+
+Delay 3000
+
+; Draw the left half of the screen over the right half
+; using the slower direct pixel access
+For x = 1 To 320
+For y = 1 To 480
+WritePixel x+320,y,ReadPixel(x,y)
+Next
+Next
+
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
-
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-For x = 1 To 640
-For y = 1 To 240
-LockBuffer FrontBuffer()
-WritePixelFast x,y+241,ReadPixelFast(x,y)
-UnlockBuffer FrontBuffer()
-Next
-Next
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-WritePixel x+320,y,ReadPixel(x,y)
-Next
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Until.htm b/_release/help/commands/2d_commands/Until.htm
index 082ab3a..864e714 100644
--- a/_release/help/commands/2d_commands/Until.htm
+++ b/_release/help/commands/2d_commands/Until.htm
@@ -1,7 +1,43 @@
-Command: Until Until condition Definition:
The closing command of the REPEAT ... UNTIL loop.
Parameter Description:
condition = any valid expression (see example)
Command Description:
This portion of the REPEAT ... UNTIL loop dictates what condition must be met before the loop stops execution. All commands between the two commands will be executed endlessly until the UNTIL condition is met.
Example:
; Repeat until user hits ESC key
+
+
+Blitz3D Docs
+
+
+
+
Until condition
+
Parameters
+
+
+
+condition = any valid expression (see example)
+
+
+
+
Description
+
+
+
+This portion of the REPEAT ... UNTIL loop dictates what condition must be met before the loop stops execution. All commands between the two commands will be executed endlessly until the UNTIL condition is met.
-Repeat
-print "Press ESC to quit this!"
-Until KeyHit(1)
-
+; Repeat until user hits ESC key
+
+Repeat
+print "Press ESC to quit this!"
+Until KeyHit(1)
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Upper.htm b/_release/help/commands/2d_commands/Upper.htm
index c997fef..4d5b8ef 100644
--- a/_release/help/commands/2d_commands/Upper.htm
+++ b/_release/help/commands/2d_commands/Upper.htm
@@ -1,4 +1,38 @@
-Command: Upper$ Upper$ (string$) Definition:
Converts a string to all upper case.
Parameter Description:
string$ = any valid string or string variable
Command Description:
This command takes the given string and converts it entirely to upper case.
Example:
name$="Shane R. Monroe"
-print "Your name all in upper case is: " + upper$(name$)
-
+name$="Shane R. Monroe"
+print "Your name all in upper case is: " + upper$(name$)
+
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/VWait.htm b/_release/help/commands/2d_commands/VWait.htm
index 519c148..f1504e4 100644
--- a/_release/help/commands/2d_commands/VWait.htm
+++ b/_release/help/commands/2d_commands/VWait.htm
@@ -1,14 +1,54 @@
-Command: VWait VWait [frames] Definition:
Waits for one or more vertical blanks to happen before continuing the program.
Parameter Description:
[frames] = optional number of frames to wait
Command Description:
There are times when you can draw too fast, and your drawing operations happen so fast that you get undesireable effects. This command forces Blitz to wait until the drawing scan line reaches the bottom of the screen before proceeding. Try the example with and without the VWAIT command.
+[frames] = optional number of frames to wait. Default is 1 frame.
+
+
+
+
Description
+
+
+
+VWait will cause the CPU to wait for the next (or specified number of) vertical blank event on the monitor
+
+There are times when you can draw too fast, and your drawing operations happen so fast that you get undesireable effects. This command forces the CPU to wait until the drawing scan line reaches the bottom of the screen before proceeding. Try the example with and without the VWait command.
+
+Note that this command is different to the vertical blank waiting mechanism in Flip because Flip will cause the graphics card (as opposed to the CPU) to wait for the next vertical blank. The vertical blank can be disabled on some graphics cards, hence it is quite common to use "VWait : Flip False" to ensure consistent updates on all setups.
-; Wait for ESC to hit
-While Not KeyHit(1)
-; Set a random color
-Color Rnd(255),Rnd(255),Rnd(255)
-; Draw a random line
-Line Rnd(800),Rnd(600),Rnd(800),Rnd(600)
-; Wait For a vertical blank to happen before looping
-VWait
-Wend
-
+; Vwait example
+Graphics 800,600,16
+
+; Wait for ESC to hit
+While Not KeyHit(1)
+; Set a random color
+Color Rnd(255),Rnd(255),Rnd(255)
+; Draw a random line
+Line Rnd(800),Rnd(600),Rnd(800),Rnd(600)
+; Wait For a vertical blank to happen before looping
+VWait
+Wend
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Viewport.htm b/_release/help/commands/2d_commands/Viewport.htm
index fe34fa5..fc2b55c 100644
--- a/_release/help/commands/2d_commands/Viewport.htm
+++ b/_release/help/commands/2d_commands/Viewport.htm
@@ -1,26 +1,59 @@
-Command: Viewport Viewport x, y, width, height Definition:
Restricts the drawing commands to a specified area of the screen.
Parameter Description:
x = the topmost left corner to start the port x coordinate
-y = the topmost left corner to start the port y coordinate
-width = how wide the port is (in pixels)
-height = how tall the port is (in pixels)
-
Command Description:
There are MANY MANY times you want to draw graphics (aliens, ships, etc) ONLY on a certain area of the screen while leaving the other areas alone. This is often referred to as 'windowing' or 'portaling' or 'clipping' an area. Usually, you will perform all your drawing operations first (background, controls, etc), then section off the restricted area of the screen with VIEWPORT to do drawing in that area. There are a million uses for this; overhead map radar screens, Ultima style display windows, onscreen scrollers, etc. This is a bit more complex than most graphic commands, so be sure you have a good handle on it before trying to use it. The biggest tip I can give you about this command is: REMEMBER TO CLEAR THE VIEWPORT WHEN YOU ARE DONE! Do this by setting the viewport to include the whole screen (i.e. Viewport 0,0,640,480 if your game was in 640x480). Look carefully at the example. Remember, the second set of numbers isn't the ENDING location of the port - rather the SIZE of the port starting at the first coordinates.
Example:
; ViewPort Example
+
+
+Blitz3D Docs
+
+
+
+
Viewport x, y, width, height
+
Parameters
+
+
+
+x = the topmost left corner to start the port x coordinate
+y = the topmost left corner to start the port y coordinate
+width = how wide the port is (in pixels)
+height = how tall the port is (in pixels)
+
+
+
+
Description
+
+
+
+There are MANY MANY times you want to draw graphics (aliens, ships, etc) ONLY on a certain area of the screen while leaving the other areas alone. This is often referred to as 'windowing' or 'portaling' or 'clipping' an area. Usually, you will perform all your drawing operations first (background, controls, etc), then section off the restricted area of the screen with VIEWPORT to do drawing in that area. There are a million uses for this; overhead map radar screens, Ultima style display windows, onscreen scrollers, etc. This is a bit more complex than most graphic commands, so be sure you have a good handle on it before trying to use it. The biggest tip I can give you about this command is: REMEMBER TO CLEAR THE VIEWPORT WHEN YOU ARE DONE! Do this by setting the viewport to include the whole screen (i.e. Viewport 0,0,640,480 if your game was in 640x480). Look carefully at the example. Remember, the second set of numbers isn't the ENDING location of the port - rather the SIZE of the port starting at the first coordinates.
+
+; ViewPort Example
+
+; Set Up Graphics Mode
+Graphics 800,600
+
+; Set up Double Buffering
+SetBuffer BackBuffer()
+
+; Set viewport starting at 100,100 and make it 200,200 pixels in size
+Viewport 100,100,200,200
+
+; Infinately draw random rectangles with random colors
+While Not KeyHit(1)
+Cls ; Clear screen in 'blitting' technique
+For t = 1 To 100 ; Do 100 rectangles each time
+Color Rnd(255),Rnd(255),Rnd(255) ; Random color
+Rect Rnd(800),Rnd(600),Rnd(300),Rnd(300),Rnd(0,1) ; Random sized and located box, some filled
+Next ; repeat that drawing loop
+Flip ; Flip to the back buffer
+Wend
+
+
-; Set up Double Buffering
-SetBuffer BackBuffer()
-
-; Set viewport starting at 100,100 and make it 200,200 pixels in size
-Viewport 100,100,200,200
-
-; Infinately draw random rectangles with random colors
-While Not KeyHit(1)
-Cls ; Clear screen in 'blitting' technique
-For t = 1 To 100 ; Do 100 rectangles each time
-Color Rnd(255),Rnd(255),Rnd(255) ; Random color
-Rect Rnd(800),Rnd(600),Rnd(300),Rnd(300),Rnd(0,1) ; Random sized and located box, some filled
-Next ; repeat that drawing loop
-Flip ; Flip to the back buffer
-Wend
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WaitJoy.htm b/_release/help/commands/2d_commands/WaitJoy.htm
index a461794..ca80218 100644
--- a/_release/help/commands/2d_commands/WaitJoy.htm
+++ b/_release/help/commands/2d_commands/WaitJoy.htm
@@ -1,18 +1,52 @@
-Command: WaitJoy WaitJoy ([port]) Definition:
Halts program execution until a joystick button is pressed and returns its button code.
Parameter Description:
port = joystick port to check
Command Description:
This command makes your program halt until a jpystick button is pressed on the joystick. Used alone, it simply halts and waits for a button press. It can also be used to assign the pressed button's code value to a variable. See example.
+
+
+Blitz3D Docs
+
+
+
+
WaitJoy ([port])
+
Parameters
+
+
+
+port = joystick port to check
+
+
+
+
Description
+
+
+
+This command makes your program halt until a jpystick button is pressed on the joystick. Used alone, it simply halts and waits for a button press. It can also be used to assign the pressed button's code value to a variable. See example.
+
+In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the button press. In that situation, you'll use a WHILE ... WEND awaiting a JoyHit value - refreshing your screen each loop.
+
+As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
+
+; WaitJoy() sample
+
+Print "Press a joystick button to continue."
+
+button=WaitJoy()
+
+Print "The joystick button code of the button you pressed was: " + button
+Print "Now press a button to quit."
+
+WaitJoy()
+
+End
+
+
+
+
-In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the button press. In that situation, you'll use a WHILE ... WEND awaiting a JoyHit value - refreshing your screen each loop.
+Index
-As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.
Example:
; WaitJoy() sample
-
-Print "Press a joystick button to continue."
-
-button=WaitJoy()
-
-Print "The joystick button code of the button you pressed was: " + button
-Print "Now press a button to quit."
-
-WaitJoy()
-
-End
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WaitKey.htm b/_release/help/commands/2d_commands/WaitKey.htm
index f06675b..2c42bef 100644
--- a/_release/help/commands/2d_commands/WaitKey.htm
+++ b/_release/help/commands/2d_commands/WaitKey.htm
@@ -1,16 +1,50 @@
-Command: WaitKey() WaitKey() Definition:
Halts program execution until a key is pressed and returns its ASCII code.
Parameter Description:
None.
Command Description:
This command makes your program halt until a key is pressed on the keyboard. Used alone, it simply halts and waits for a key press. It can also be used to assign the pressed key's ASCII value to a variable. See example.
+
+
+Blitz3D Docs
+
+
+
+
WaitKey()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+This command makes your program halt until a key is pressed on the keyboard. Used alone, it simply halts and waits for a key press. It can also be used to assign the pressed key's ASCII value to a variable. See example.
+
+In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the keypress. In that situation, you'll use a WHILE ... WEND awaiting a KeyHit value - refreshing your screen each loop.
+
+; WaitKey() sample
+
+Print "Press any key to continue."
+
+key=WaitKey()
+
+Print "The ASCII code of the key you pressed was: " + key
+Print "Now press a key to quit."
+
+WaitKey()
+
+End
+
+
+
+
-In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the keypress. In that situation, you'll use a WHILE ... WEND awaiting a KeyHit value - refreshing your screen each loop.
-Print "Press any key to continue."
-
-key=WaitKey()
-
-Print "The ASCII code of the key you pressed was: " + key
-Print "Now press a key to quit."
-
-WaitKey()
-
-End
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WaitMouse.htm b/_release/help/commands/2d_commands/WaitMouse.htm
index c35dd04..d1c637c 100644
--- a/_release/help/commands/2d_commands/WaitMouse.htm
+++ b/_release/help/commands/2d_commands/WaitMouse.htm
@@ -1,16 +1,50 @@
-Command: WaitMouse() WaitMouse() Definition:
Halts program execution until a mouse button is pressed and returns its button code.
Parameter Description:
None.
Command Description:
This command makes your program halt until a mouse button is pressed on the mouse. Used alone, it simply halts and waits for a button press. It can also be used to assign the pressed button's code value to a variable. See example.
+
+
+Blitz3D Docs
+
+
+
+
WaitMouse()
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+This command makes your program halt until a mouse button is pressed on the mouse. Used alone, it simply halts and waits for a button press. It can also be used to assign the pressed button's code value to a variable. See example.
+
+In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the button press. In that situation, you'll use a WHILE ... WEND awaiting a MouseHit value - refreshing your screen each loop.
+
+; WaitMouse() sample
+
+Print "Press a mouse button to continue."
+
+button=WaitMouse()
+
+Print "The mouse button code of the button you pressed was: " + button
+Print "Now press a button to quit."
+
+WaitMouse()
+
+End
+
+
+
+
-In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the button press. In that situation, you'll use a WHILE ... WEND awaiting a MouseHit value - refreshing your screen each loop.
-Print "Press a mouse button to continue."
-
-button=WaitMouse()
-
-Print "The mouse button code of the button you pressed was: " + button
-Print "Now press a button to quit."
-
-WaitMouse()
-
-End
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WaitTimer.htm b/_release/help/commands/2d_commands/WaitTimer.htm
index 114c89d..cdf4796 100644
--- a/_release/help/commands/2d_commands/WaitTimer.htm
+++ b/_release/help/commands/2d_commands/WaitTimer.htm
@@ -1,12 +1,45 @@
-Command: WaitTimer WaitTimer (timer_variable) Definition:
Pauses execution until the requested timer meets its value.
Parameter Description:
timer = any valid timer variable created with the CreateTimer command.
Command Description:
Use this in conjunction with the CreateTimer command. This command will halt execution until the timer reaches its value. This is useful to control the execution speed of your program. Check out the CreateTime command for more.
Example:
; Create the timer to track speed
-frameTimer=CreateTimer(60)
+
+
+Blitz3D Docs
+
+
+
+
WaitTimer (timer_variable)
+
Parameters
+
+
+
+timer = any valid timer variable created with the CreateTimer command.
+
+
+
+
Description
+
+
+
+Use this in conjunction with the CreateTimer command. This command will halt execution until the timer reaches its value. This is useful to control the execution speed of your program. Check out the CreateTimer command for more.
+
+; Create the timer to track speed
+frameTimer=CreateTimer(60)
+
+; Your main screen draw loop
+While Not KeyHit(1)
+WaitTimer(frameTimer) ; Pause until the timer reaches 60
+Cls
+; Draw your screen stuff
+Flip
+Wend
+
+
+
-; Your main screen draw loop
-While Not KeyHit(1)
-WaitTimer(frameTimer) ; Pause until the timer reaches 60
-Cls
-; Draw your screen stuff
-Flip
-Wend
-
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Wend.htm b/_release/help/commands/2d_commands/Wend.htm
index 1a4e266..e591fc0 100644
--- a/_release/help/commands/2d_commands/Wend.htm
+++ b/_release/help/commands/2d_commands/Wend.htm
@@ -1,7 +1,44 @@
-Command: Wend Wend Definition:
The closing command of a WHILE/WEND loop.
Parameter Description:
None.
Command Description:
This is the command that tells program execution to branch to the beginning of the WHILE/WEND loop at the WHILE command. See the WHILE command for complete details.
Example:
; While/Wend Example
+
+
+Blitz3D Docs
+
+
+
+
Wend
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+This is the command that tells program execution to branch to the beginning of the WHILE/WEND loop at the WHILE command. See the WHILE command for complete details.
-; The loop condition is at the TOP of the loop
-While Not KeyHit(1) ; As long as the user hasn't hit ESC yet ...
-Print "Press Esc to end this mess!" ; Print this
-Wend ; Go back to the start of the WHILE loop
+; While/Wend Example
+
+; The loop condition is at the TOP of the loop
+While Not KeyHit(1) ; As long as the user hasn't hit ESC yet ...
+Print "Press Esc to end this mess!" ; Print this
+Wend ; Go back to the start of the WHILE loop
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/While.htm b/_release/help/commands/2d_commands/While.htm
index d56e5cb..2e8bdd2 100644
--- a/_release/help/commands/2d_commands/While.htm
+++ b/_release/help/commands/2d_commands/While.htm
@@ -1,7 +1,44 @@
-Command: While While condition Definition:
Begins a WHILE/WEND conditional loop.
Parameter Description:
condition = any valid conditional statement
Command Description:
The WHILE/WEND loop is used when you wish to execute a series of commands multiple times based on whether a condition is true or not. This is similar to the REPEAT/UNTIL loop, except the condition checking is at the beginning of the loop, instead of at the end. Usually you'll use WHILE/WEND when you aren't sure whether or not the looped commands will even need to be executed once, since you can actually stop the loop before any commands are executed if the condition check fails. If you need to execute the commands in the loop at least once before checking a condition, use REPEAT/UNTIL. See example.
Example:
; While/Wend Example
+
+
+Blitz3D Docs
+
+
+
+
While condition
+
Parameters
+
+
+
+condition = any valid conditional statement
+
+
+
+
Description
+
+
+
+The WHILE/WEND loop is used when you wish to execute a series of commands multiple times based on whether a condition is true or not. This is similar to the REPEAT/UNTIL loop, except the condition checking is at the beginning of the loop, instead of at the end. Usually you'll use WHILE/WEND when you aren't sure whether or not the looped commands will even need to be executed once, since you can actually stop the loop before any commands are executed if the condition check fails. If you need to execute the commands in the loop at least once before checking a condition, use REPEAT/UNTIL. See example.
-; The loop condition is at the TOP of the loop
-While Not KeyHit(1) ; As long as the user hasn't hit ESC yet ...
-Print "Press Esc to end this mess!" ; Print this
-Wend ; Go back to the start of the WHILE loop
+; While/Wend Example
+
+; The loop condition is at the TOP of the loop
+While Not KeyHit(1) ; As long as the user hasn't hit ESC yet ...
+Print "Press Esc to end this mess!" ; Print this
+Wend ; Go back to the start of the WHILE loop
+
+
+
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Write.htm b/_release/help/commands/2d_commands/Write.htm
index ba9d96b..16e9890 100644
--- a/_release/help/commands/2d_commands/Write.htm
+++ b/_release/help/commands/2d_commands/Write.htm
@@ -1,6 +1,43 @@
-Command: Write Write string$ Definition:
Writes a string to the current screen or graphic buffer.
Parameter Description:
string$ = any valid string
Command Description:
This command will write a string value to the screen (if not in a graphic mode) or to the current drawing buffer being used by the program. This command doesn't put a carriage return/linefeed at the end of the line (see the Print command for that feature).
Example:
; Get the user's name and print a welcome
+
+
+Blitz3D Docs
+
+
+
+
Write string$
+
Parameters
+
+
+
+string$ - string variable or value
+
+
+
+
Description
+
+
+
+Writes a string to the front buffer (i.e. the screen), but doesn't then start a new line (unlike Print).
+
+See also: Print.
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteByte.htm b/_release/help/commands/2d_commands/WriteByte.htm
index 6f672e4..0c05ca3 100644
--- a/_release/help/commands/2d_commands/WriteByte.htm
+++ b/_release/help/commands/2d_commands/WriteByte.htm
@@ -1,66 +1,97 @@
-Command: WriteByte WriteByte (filehandle|stream, mybyte) Definition:
Writes a single byte of data to an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
-mybyte = can be an Integer or a floating point number, but only values between 0 and 255 will be stored faithfully.
Command Description:
Once you've opened a disk file (or stream) for reading, use this command to write a single byte at a time to the file/stream. Note, a byte is an integer that can take the values 0..255 and occupies 8 bits of storage. Since characters are stored as byte values this function can be used to create a text file one character at a time.
+
+
+Blitz3D Docs
+
+
+
+
WriteByte (filehandle/stream, mybyte)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
+mybyte = can be an Integer or a floating point number, but only values between 0 and 255 will be stored faithfully.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for reading, use this command to write a single byte at a time to the file/stream. Note, a byte is an integer that can take the values 0..255 and occupies 8 bits of storage. Since characters are stored as byte values this function can be used to create a text file one character at a time.
+
+Advanced notes:
+
+The number that is stored by WriteByte is actually the least significant byte of an integer so negative numbers and numbers above 255 will still have a value between 0..255. Unless you understand how 32 bit integers are stored in 2's compliment notation this will seem strange but it is NOT a bug.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and Writing a file using ReadByte and WriteByte functions
+
+; Initialise some variables for the example
+Byte1% = 10 ; store 10
+Byte2% = 100 ; store 100
+Byte3% = 255 ; store 255 ( the maximum value that can be stored in a Byte )
+Byte4% = 256 ; try to store 256 this will end up as 0 ( i.e. 256 - 256 = 0 )
+Byte5% = 257 ; try to store 257 this will end up as 1 ( i.e. 257 - 256 = 1 )
+Byte6% = -1 ; try to store -1 this will end up as 255 ( i.e. 256 -1 = 255 )
+Byte7% = -2 ; try to store 256 this will end up as 254 ( i.e. 256 - 2 = 254 )
+Byte8% = Asc("A") ; Store the ASCII value for the Character "A" ( i.e. 65 )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat ")
+
+; Write the information to the file
+WriteByte( fileout, Byte1 )
+WriteByte( fileout, Byte2 )
+WriteByte( fileout, Byte3 )
+WriteByte( fileout, Byte4 )
+WriteByte( fileout, Byte5 )
+WriteByte( fileout, Byte6 )
+WriteByte( fileout, Byte7 )
+WriteByte( fileout, Byte8 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1 = ReadByte( filein )
+Read2 = ReadByte( filein )
+Read3 = ReadByte( filein )
+Read4 = ReadByte( filein )
+Read5 = ReadByte( filein )
+Read6 = ReadByte( filein )
+Read7 = ReadByte( filein )
+Read8 = ReadByte( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Written - Read"
+Write Byte1 + " - " : Print Read1
+Write Byte2 + " - " : Print Read2
+Write Byte3 + " - " : Print Read3
+Write Byte4 + " - " : Print Read4
+Write Byte5 + " - " : Print Read5
+Write Byte6 + " - " : Print Read6
+Write Byte7 + " - " : Print Read7
+Write Byte8 + " - " : Print Chr$( Read8 )
+
+WaitKey()
+
+
; Reading and Writing a file using ReadByte and WriteByte functions
-
-; Initialise some variables for the example
-Byte1% = 10 ; store 10
-Byte2% = 100 ; store 100
-Byte3% = 255 ; store 255 ( the maximum value that can be stored in a Byte )
-Byte4% = 256 ; try to store 256 this will end up as 0 ( i.e. 256 - 256 = 0 )
-Byte5% = 257 ; try to store 257 this will end up as 1 ( i.e. 257 - 256 = 1 )
-Byte6% = -1 ; try to store -1 this will end up as 255 ( i.e. 256 -1 = 255 )
-Byte7% = -2 ; try to store 256 this will end up as 254 ( i.e. 256 - 2 = 254 )
-Byte8% = Asc("A") ; Store the ASCII value for the Character "A" ( i.e. 65 )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat ")
-
-; Write the information to the file
-WriteByte( fileout, Byte1 )
-WriteByte( fileout, Byte2 )
-WriteByte( fileout, Byte3 )
-WriteByte( fileout, Byte4 )
-WriteByte( fileout, Byte5 )
-WriteByte( fileout, Byte6 )
-WriteByte( fileout, Byte7 )
-WriteByte( fileout, Byte8 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1 = ReadByte( filein )
-Read2 = ReadByte( filein )
-Read3 = ReadByte( filein )
-Read4 = ReadByte( filein )
-Read5 = ReadByte( filein )
-Read6 = ReadByte( filein )
-Read7 = ReadByte( filein )
-Read8 = ReadByte( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Written - Read"
-Write Byte1 + " - " : Print Read1
-Write Byte2 + " - " : Print Read2
-Write Byte3 + " - " : Print Read3
-Write Byte4 + " - " : Print Read4
-Write Byte5 + " - " : Print Read5
-Write Byte6 + " - " : Print Read6
-Write Byte7 + " - " : Print Read7
-Write Byte8 + " - " : Print Chr$( Read8 )
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteBytes.htm b/_release/help/commands/2d_commands/WriteBytes.htm
index a9d8870..6d051df 100644
--- a/_release/help/commands/2d_commands/WriteBytes.htm
+++ b/_release/help/commands/2d_commands/WriteBytes.htm
@@ -1,49 +1,84 @@
-Command: WriteBytes WriteBytes bank,filehandle|stream,offset,count Definition:
Write data from a memory bank to a file (or stream).
Parameter Description:
bank = variable containing handle to valid bank
-filehandle|stream = a valid variable set with the WriteFile or OpenTCPStream (v1.52+)
-offset = offset in bytes to write the value
-count = how many bytes to write from the offset
-
Command Description:
You can write the contents of a memory bank to a file on disk (or stream) using this command.
+
+
+Blitz3D Docs
+
+
+
+
WriteBytes bank,filehandle/stream,offset,count
+
Parameters
+
+
+
+bank = variable containing handle to valid bank
+filehandle/stream = a valid variable set with the WriteFile or OpenTCPStream (v1.52+)
+offset = offset in bytes to write the value
+count = how many bytes to write from the offset
+
+
+
+
Description
+
+
+
+You can write the contents of a memory bank to a file on disk (or stream) using this command.
+
+Note: The file handle must be opened with WriteFile or OpenTCPStream and subsequently closed with CloseFile or CloseTCPStream after the writing operations are complete.
+Return how many bytes successfully written to a stream.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
-Note: The file handle must be opened with WriteFile or OpenTCPStream and subsequently closed with CloseFile or CloseTCPStream after the writing operations are complete.
-Return how many bytes successfully written to a stream.
-Streams can only be used in Blitz Basic v1.52 or greater.
Example:
; Read/WriteBytes Commands Example
-; Create a 50 byte memory bank
-bnkTest=CreateBank(500)
+See also: ReadBytes.
+
+; Read/WriteBytes Commands Example
+
+; Create a 50 byte memory bank
+bnkTest=CreateBank(500)
+
+; Let's fill the bank with random data
+For t = 1 To 50
+
+ PokeByte bnkTest,t,Rnd(255)
+
+Next
+
+; Open a file to write to
+fileBank=WriteFile("test.bnk")
+; Write the bank to the file
+WriteBytes bnkTest,fileBank,0,50
+; Close it
+CloseFile fileBank
+
+; Free the bank
+FreeBank bnkTest
+
+; Make a new one
+bnkTest=CreateBank(500)
+
+; Open the file to read from
+fileBank=OpenFile("test.bnk")
+; Write the bank to the file
+ReadBytes bnkTest,fileBank,0,50
+; Close it
+CloseFile fileBank
+
+; Write back the results!
+For t = 1 To 50
+
+ Print PeekByte (bnkTest,t)
+
+Next
+
+
+
-; Let's fill the bank with crap
-For t = 1 To 50
-PokeByte bnkTest,t,Rnd(255)
-PokeInt bnkTest,t+1,Rnd(10000)
-PokeShort bnkTest,t+2,Rnd(10000)
-PokeFloat bnkTest,t+3,Rnd(-.999,.999)
-Next
+Index
-; Open a file to write to
-fileBank=WriteFile("test.bnk")
-; Write the bank to the file
-WriteBytes bnkTest,fileBank,0,50
-; Close it
-CloseFile fileBank
-
-; Free the bank
-FreeBank bnkTest
-
-; Make a new one
-bnkTest=CreateBank(500)
-
-; Open the file to read from
-fileBank=OpenFile("test.bnk")
-; Write the bank to the file
-ReadBytes bnkTest,fileBank,0,50
-; Close it
-CloseFile fileBank
-
-; Write back the results!
-For t = 1 To 50
-Print PeekByte (bnkTest,t)
-Print PeekInt (bnkTest,t+1)
-Print PeekShort (bnkTest,t+2)
-Print PeekFloat (bnkTest,t+3)
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteFile.htm b/_release/help/commands/2d_commands/WriteFile.htm
index 2599e6e..993c05b 100644
--- a/_release/help/commands/2d_commands/WriteFile.htm
+++ b/_release/help/commands/2d_commands/WriteFile.htm
@@ -1,54 +1,82 @@
-Command: WriteFile WriteFile (filename$) Definition:
Opens a file on disk for writing operations.
Parameter Description:
filename$ = any valid path and filename. The returned value is the filehandle which is an integer value.
Command Description:
This command opens the designated filename and prepares it to be written to. Use this to write your own configuration file, save game data, etc. also useful for saving custom types to files. The filehandle that is returned is
-an integer value that the operating system uses to identify which file is to be written to and must be passed to the functions such as WriteInt(). If the file could not be opened then the filehandle is Zero.
+
+
+Blitz3D Docs
+
+
+
+
WriteFile (filename$)
+
Parameters
+
+
+
+filename$ = any valid path and filename. The returned value is the filehandle which is an integer value.
+
+
+
+
Description
+
+
+
+This command opens the designated filename and prepares it to be written to. Use this to write your own configuration file, save game data, etc. also useful for saving custom types to files. The filehandle that is returned is an integer value that the operating system uses to identify which file is to be written to and must be passed to the functions such as WriteInt(). If the file could not be opened then the filehandle is Zero.
+
; Reading and writing custom types to files using ReadFile, WriteFile and
-CloseFile
+Index
-; Initialise some variables for the example
-Type HighScore
- Field Name$
- Field Score%
- Field Level%
-End Type
-
-Best.HighScore = New HighScore
-Best\Name = "Mark"
-Best\Score = 11657
-Best\Level = 34
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteString( fileout, Best\Name )
-WriteInt( fileout, Best\Score )
-WriteByte( fileout, Best\Level )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-; Lets read the Greatest score from the file
-Greatest.HighScore = New HighScore
-Greatest\Name$ = ReadString$( filein )
-Greatest\Score = ReadInt( filein )
-Greatest\Level = ReadByte( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "High score record read from - mydata.dat "
-Print
-Write "Name = "
-Print Greatest\Name
-Write "Score = "
-Print Greatest\Score
-Write "Level = "
-Print Greatest\Level
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteFloat.htm b/_release/help/commands/2d_commands/WriteFloat.htm
index 7603622..25eb66f 100644
--- a/_release/help/commands/2d_commands/WriteFloat.htm
+++ b/_release/help/commands/2d_commands/WriteFloat.htm
@@ -1,45 +1,77 @@
-Command: WriteFloat WriteFloat (filehandle|stream, myFloat) Definition:
Writes a single floating point value to an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
-myFloat = a floating point variable
Command Description:
Once you've opened a disk file (or stream) for writing, use this command to write a single floating point number to the file. Note, each value written uses 4 bytes.
+
+
+Blitz3D Docs
+
+
+
+
WriteFloat (filehandle/stream, myFloat)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
+myFloat = a floating point variable
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for writing, use this command to write a single floating point number to the file. Note, each value written uses 4 bytes.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadFloat and WriteFloat functions
+
+; Initialise some variables for the example
+Num1# = 10.5 ; store 10.5
+Num2# = 365.25 ; store 365.25
+Num3# = 32767.123 ; 32767.123 is the largest positive Short Integer Value in BlitzBasic )
+Num4# = -32768.123 ; -32768.123 the largest negative Short Integer Value in BlitzBasic )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteFloat( fileout, Num1 )
+WriteFloat( fileout, Num2 )
+WriteFloat( fileout, Num3 )
+WriteFloat( fileout, Num4 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1# = ReadFloat( filein )
+Read2# = ReadFloat( filein )
+Read3# = ReadFloat( filein )
+Read4# = ReadFloat( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Floating Point Data Read From File - mydata.dat "
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Streams can only be used in Blitz Basic v1.52 or greater.
+Index
; Reading and writing a file using ReadFloat and WriteFloat functions
-
-; Initialise some variables for the example
-Num1# = 10.5 ; store 10.5
-Num2# = 365.25 ; store 365.25
-Num3# = 32767.123 ; 32767.123 is the largest positive Short Integer Value in BlitzBasic )
-Num4# = -32768.123 ; -32768.123 the largest negative Short Integer Value in BlitzBasic )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteFloat( fileout, Num1 )
-WriteFloat( fileout, Num2 )
-WriteFloat( fileout, Num3 )
-WriteFloat( fileout, Num4 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1# = ReadFloat( filein )
-Read2# = ReadFloat( filein )
-Read3# = ReadFloat( filein )
-Read4# = ReadFloat( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Floating Point Data Read From File - mydata.dat "
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteInt.htm b/_release/help/commands/2d_commands/WriteInt.htm
index 0630b1d..c2ada78 100644
--- a/_release/help/commands/2d_commands/WriteInt.htm
+++ b/_release/help/commands/2d_commands/WriteInt.htm
@@ -1,45 +1,77 @@
-Command: WriteInt WriteInt (filehandle|stream, myinteger) Definition:
Write a single 32bit integer value to an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
-myinteger = an integer variable (a floating point number can be used but this will be converted to an integer before saving so only the integer part will be saved)
Command Description:
Once you've opened a disk file (or stream) for writing, use this command to write a single integer value to the file. Note, each value written uses 4 bytes and is written least significant byte first. The range of the value saved is -2147483648 to 2147483647
+
+
+Blitz3D Docs
+
+
+
+
WriteInt (filehandle/stream, myinteger)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
+myinteger = an integer variable (a floating point number can be used but this will be converted to an integer before saving so only the integer part will be saved)
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for writing, use this command to write a single integer value to the file. Note, each value written uses 4 bytes and is written least significant byte first. The range of the value saved is -2147483648 to 2147483647
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadInt and WriteInt functions
+
+; Initialise some variables for the example
+Int1% = 10 ; store 10
+Int2% = 365 ; store 365
+Int3% = 2147483647; store 2147483647 the largest positive Integer Value in BlitzBasic )
+Int4% = - 2147483648 ; store -2147483648 the largest negative Integer Value in BlitzBasic )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteInt( fileout, Int1 )
+WriteInt( fileout, Int2 )
+WriteInt( fileout, Int3 )
+WriteInt( fileout, Int4 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1 = ReadInt( filein )
+Read2 = ReadInt( filein )
+Read3 = ReadInt( filein )
+Read4 = ReadInt( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Integer Data Read From File - mydata.dat "
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Streams can only be used in Blitz Basic v1.52 or greater.
+Index
; Reading and writing a file using ReadInt and WriteInt functions
-
-; Initialise some variables for the example
-Int1% = 10 ; store 10
-Int2% = 365 ; store 365
-Int3% = 2147483647; store 2147483647 the largest positive Integer Value in BlitzBasic )
-Int4% = - 2147483648 ; store -2147483648 the largest negative Integer Value in BlitzBasic )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteInt( fileout, Int1 )
-WriteInt( fileout, Int2 )
-WriteInt( fileout, Int3 )
-WriteInt( fileout, Int4 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1 = ReadInt( filein )
-Read2 = ReadInt( filein )
-Read3 = ReadInt( filein )
-Read4 = ReadInt( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Integer Data Read From File - mydata.dat "
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteLine.htm b/_release/help/commands/2d_commands/WriteLine.htm
index d7a8129..ec3f08c 100644
--- a/_release/help/commands/2d_commands/WriteLine.htm
+++ b/_release/help/commands/2d_commands/WriteLine.htm
@@ -1,48 +1,78 @@
-Command: WriteLine$ WriteLine$ (filehandle|stream, string$) Definition:
Writes a single line of text to an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+).
-The value returned is a text string.
-string$ = valid string value.
Command Description:
Once you've opened a disk file (or stream) for writing, use this command to right a whole line of text to the file. Each line of text is automatically terminated with an "end-of-line" mark, consisting of a Carriage Return character followed by a LineFeed character. (i.e. 0Dh, 0Ah ) This function
-can be used to make plain text files.
+
+
+Blitz3D Docs
+
+
+
+
WriteLine$ (filehandle/stream, string$)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+). The value returned is a text string.
+string$ = valid string value.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for writing, use this command to right a whole line of text to the file. Each line of text is automatically terminated with an "end-of-line" mark, consisting of a Carriage Return character followed by a LineFeed character. (i.e. 0Dh, 0Ah ) This function can be used to make plain text files.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadLine$ and WriteLine functions
+
+; Initialise some variables for the example
+String1$ = "Line 1 is short"
+String2$ = "Line 2 is a longer line but they can be much longer"
+String3$ = "Line 3 is made up "
+String4$ = "of two parts joined together."
+
+; Open a file to write to
+fileout = WriteFile("mydata.txt")
+
+; Write the information to the file
+WriteLine( fileout, String1 )
+WriteLine( fileout, String2 )
+WriteLine( fileout, String3 + String4)
+WriteLine( fileout, "Just to show you don't have to use variables" )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.txt")
+
+Read1$ = ReadLine( filein )
+Read2$ = ReadLine$( filein )
+Read3$ = ReadLine$( filein )
+Read4$ = ReadLine$( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Lines of text read from file - mydata.txt "
+Print
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Streams can only be used in Blitz Basic v1.52 or greater.
+Index
; Reading and writing a file using ReadLine$ and WriteLine functions
-
-; Initialise some variables for the example
-String1$ = "Line 1 is short"
-String2$ = "Line 2 is a longer line but they can be much longer"
-String3$ = "Line 3 is made up "
-String4$ = "of two parts joined together."
-
-; Open a file to write to
-fileout = WriteFile("mydata.txt")
-
-; Write the information to the file
-WriteLine( fileout, String1 )
-WriteLine( fileout, String2 )
-WriteLine( fileout, String3 + String4)
-WriteLine( fileout, "Just to show you don't have to use variables" )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.txt")
-
-Read1$ = ReadLine( filein )
-Read2$ = ReadLine$( filein )
-Read3$ = ReadLine$( filein )
-Read4$ = ReadLine$( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Lines of text read from file - mydata.txt "
-Print
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WritePixel.htm b/_release/help/commands/2d_commands/WritePixel.htm
index c1f67ed..fd0db13 100644
--- a/_release/help/commands/2d_commands/WritePixel.htm
+++ b/_release/help/commands/2d_commands/WritePixel.htm
@@ -1,37 +1,80 @@
-Command: WritePixel WritePixel x,y,rgb,[buffer] Definition:
Quickly writes a pixel to an image buffer.
Parameter Description:
x = x location of the pixel to read
-y = y location of the pixel to read
-rgb = rgb pixel value to write
-buffer = any valid screen/image buffer (optional)
Command Description:
This command will allow you fast access to a specific pixel in the buffer selected. While the ReadPixel command reads the pixel quickly (and you write it back with this command), it is still not fast enough for real-time screen effects.
+
+
+Blitz3D Docs
+
+
+
+
WritePixel x,y,argb,[buffer]
+
Parameters
+
+
+
+x - y-coordinate of pixel
+y - y-coordinate of pixel
+argb - argb colour value of pixel (alpha, red, green, blue)
+buffer (optional) - name of buffer to write colour value to, e.g. BackBuffer()
+
+
+
+
Description
+
+
+
+Writes a color value to either the current buffer or the specified buffer.
+
+You can use this command on a locked buffer for a slight speed-up.
-You are not required to lock the buffer with LockBuffer and subsequently unlock the buffer with UnlockBuffer. However, the operations will be a bit faster if you do.
+; ReadPixel/WritePixel Example
+; ----------------------------
+
+Graphics 640,480,16
+
+Print "Press a key to read color values (this may take a few seconds)"
+WaitKey()
+
+; Load and draw an image on to the screen - can be anything
+pic=LoadImage("media/blitz_pic.bmp")
+DrawImage pic,0,0
+
+; Initialise an array big enough to fit all the color information of the screen
+Dim pix(GraphicsWidth(),GraphicsHeight())
+
+; Use ReadPixel to get all the color information of the screen
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+pix(x,y)=ReadPixel(x,y)
+Next
+Next
+
+Cls
+Locate 0,0
+Print "Press a key to write pixels (this may takes a few seconds)"
+Print "Once this has finished, you can then press a key to end the program"
+
+WaitKey()
+
+; Use WritePixel to redraw the screen using the color information we got earlier
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+WritePixel x,y,pix(x,GraphicsHeight()-y) ; get y array value in backwards order, to flip screen
+Next
+Next
+
+WaitKey()
+
+
+
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
+Index
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-LockBuffer FrontBuffer()
-For x = 1 To 640
-For y = 1 To 240
-WritePixelFast x,y+241,ReadPixelFast(x,y)
-Next
-Next
-UnlockBuffer FrontBuffer()
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-WritePixel x+320,y,ReadPixel(x,y)
-Next
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WritePixelFast.htm b/_release/help/commands/2d_commands/WritePixelFast.htm
index fade424..37cc05b 100644
--- a/_release/help/commands/2d_commands/WritePixelFast.htm
+++ b/_release/help/commands/2d_commands/WritePixelFast.htm
@@ -1,39 +1,100 @@
-Command: WritePixelFast WritePixelFast x,y,rgb,[buffer] Definition:
High speed pixel writing to an image buffer.
Parameter Description:
x = x location of the pixel to read
-y = y location of the pixel to read
-rgb = rgb pixel value to write
-buffer = any valid screen/image buffer (optional)
Command Description:
This command will allow you fast access to a specific pixel in the buffer selected. While the ReadPixelFast command reads the pixel quickly (and it is written back quickly with this command, it is still not fast enough for real-time screen effects.
+
+
+Blitz3D Docs
+
+
+
+
WritePixelFast x,y,rgb,[buffer]
+
Parameters
+
+
+
+x - y-coordinate of pixel
+y - y-coordinate of pixel
+argb - argb colour value of pixel (alpha, red, green, blue)
+buffer (optional) - name of buffer to write colour value to, e.g. BackBuffer()
+
+
+
+
Description
+
+
+
+Writes a colour value to either the current buffer or the specified buffer.
+
+IMPORTANT:
+
+You *must* use this command on a locked buffer, otherwise the command will fail. See LockBuffer.
+
+Also, you must make sure that the coordinates that you are writing to are valid, otherwise you will end up overwriting other areas of memory.
+
+WARNING:
+
+By not following the above advice, you may cause your computer to crash.
+
+See also: Plot, WritePixel.
+
+; ReadPixelFast/WritePixeFast Example
+; -----------------------------------
+
+Graphics 640,480,16
+
+Print "Press a key to read color values"
+WaitKey()
+
+; Load and draw an image on to the screen - can be anything
+pic=LoadImage("media/blitz_pic.bmp")
+DrawImage pic,0,0
+
+; Initialise an array big enough to fit all the color information of the screen
+Dim pix(GraphicsWidth(),GraphicsHeight())
+
+; Lock buffer before using ReadPixelFast
+LockBuffer
+
+; Use ReadPixel to get all the color information of the screen
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+pix(x,y)=ReadPixelFast(x,y)
+Next
+Next
+
+; Lock buffer after using ReadPixelFast
+UnlockBuffer
+
+Cls
+Locate 0,0
+Print "Press a key to write pixels"
+Print "Once this has finished, you can then press a key to end the program"
+
+WaitKey()
+
+; Lock buffer before using WritePixelFast
+LockBuffer
+
+; Use WritePixel to redraw the screen using the color information we got earlier
+For y=0 To GraphicsHeight()
+For x=0 To GraphicsWidth()
+WritePixelFast x,y,pix(x,GraphicsHeight()-y) ; get y array value in backwards order, to flip screen
+Next
+Next
+
+; Unlock buffer after using WritePixelFast
+UnlockBuffer
+
+WaitKey()
+
+
+
+
-You are required to lock the buffer with LockBuffer and subsequently unlock the buffer with UnlockBuffer when the operations are complete before any other graphics commands can be used.
+Index
-WARNING: You are playing with power. There is nothing keeping you from writing directly to memory off the screen and TRASHING it. You can crash Blitz using this command.
Example:
; High Speed Graphics Commands
-
-Graphics 640,480,16
-
-; Draw a bunch of crap on the screen
-For t= 1 To 1000
-Color Rnd(255),Rnd(255),Rnd(255)
-Rect Rnd(640),Rnd(480),Rnd(150),Rnd(150),Rnd(1)
-Next
-
-Delay 3000
-
-; Copy the top half of the screen over the bottom half
-; using fast pixels and locked buffers
-LockBuffer FrontBuffer()
-For x = 1 To 640
-For y = 1 To 240
-WritePixelFast x,y+241,ReadPixelFast(x,y)
-Next
-Next
-UnlockBuffer FrontBuffer()
-
-Delay 3000
-
-; Draw the left half of the screen over the right half
-; using the slower direct pixel access
-For x = 1 To 320
-For y = 1 To 480
-WritePixel x+320,y,ReadPixel(x,y)
-Next
-Next
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteShort.htm b/_release/help/commands/2d_commands/WriteShort.htm
index 324efc0..30b3ef4 100644
--- a/_release/help/commands/2d_commands/WriteShort.htm
+++ b/_release/help/commands/2d_commands/WriteShort.htm
@@ -1,45 +1,77 @@
-Command: WriteShort WriteShort (filehandle|stream, myinteger) Definition:
Write a single short integer value (16 bits) to an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
-myinteger = an integer variable (a floating point number can be used but this will be converted to an integer before saving so only the integer part will be saved)
Command Description:
Once you've opened a disk file (or stream) for writing, use this command to write a single short integer (16 bit) value to the file. Note, each value written uses 2 bytes and is written least significant byte first. The range of the value saved is 0-65535
+
+
+Blitz3D Docs
+
+
+
+
WriteShort (filehandle/stream, myinteger)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
+myinteger = an integer variable (a floating point number can be used but this will be converted to an integer before saving so only the integer part will be saved)
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for writing, use this command to write a single short integer (16 bit) value to the file. Note, each value written uses 2 bytes and is written least significant byte first. The range of the value saved is 0-65535
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadShort and WriteShort functions
+
+; Initialise some variables for the example
+Int1% = 10 ; store 10
+Int2% = 365 ; store 365
+Int3% = 32767 ; 32767 is the largest positive Short Integer Value in BlitzBasic )
+Int4% = -32768 ; -32768 the largest negative Short Integer Value in BlitzBasic )
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteShort( fileout, Int1 )
+WriteShort( fileout, Int2 )
+WriteShort( fileout, Int3 )
+WriteShort( fileout, Int4 )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1 = ReadShort( filein )
+Read2 = ReadShort( filein )
+Read3 = ReadShort( filein )
+Read4 = ReadShort( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "Short Integer Data Read From File - mydata.dat "
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Streams can only be used in Blitz Basic v1.52 or greater.
; Reading and writing a file using ReadShort and WriteShort functions
+Index
-; Initialise some variables for the example
-Int1% = 10 ; store 10
-Int2% = 365 ; store 365
-Int3% = 32767 ; 32767 is the largest positive Short Integer Value in BlitzBasic )
-Int4% = -32768 ; -32768 the largest negative Short Integer Value in BlitzBasic )
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteShort( fileout, Int1 )
-WriteShort( fileout, Int2 )
-WriteShort( fileout, Int3 )
-WriteShort( fileout, Int4 )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1 = ReadShort( filein )
-Read2 = ReadShort( filein )
-Read3 = ReadShort( filein )
-Read4 = ReadShort( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "Short Integer Data Read From File - mydata.dat "
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/WriteString.htm b/_release/help/commands/2d_commands/WriteString.htm
index c228b75..172cd7a 100644
--- a/_release/help/commands/2d_commands/WriteString.htm
+++ b/_release/help/commands/2d_commands/WriteString.htm
@@ -1,50 +1,80 @@
-Command: WriteString$ WriteString$ (filehandle|stream, mystring) Definition:
Writes a single string variable to an open file (or stream).
Parameter Description:
filehandle|stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
-mystring = any string variable or text contained between quotes.
Command Description:
Once you've opened a disk file (or stream) for writing, use this command to write a string variable to the file.
+
+
+Blitz3D Docs
+
+
+
+
WriteString (filehandle/stream, mystring$)
+
Parameters
+
+
+
+filehandle/stream = a valid variable set with the OpenFile, WriteFile command, or OpenTCPStream (v1.52+)
+mystring$ = any string variable or text contained between quotes.
+
+
+
+
Description
+
+
+
+Once you've opened a disk file (or stream) for writing, use this command to write a string variable to the file.
+
+Each string is stored in the file as a 4 byte (32bit) integer followed by the characters that form the string. The integer contains the number of characters in the string, i.e. its length. Note, that Carriage Return, Line Feed and Null characters are NOT use to indicate the end of the string. A file of strings cannot be read like a text file, since it contains string variables and not text. A null string, i.e. a string of zero length ("") is stored as 4 bytes, an integer count with a value = zero, followed by no Characters. Note strings are not limited to 255 characters as in some languages. Reading beyond the end of file does not result in an error, but each value read will be a zero length string.
+
+Streams can only be used in Blitz Basic v1.52 or greater.
+
+; Reading and writing a file using ReadString$ and WriteString functions
+
+; Initialise some variables for the example
+String1$ = "A short string"
+String2$ = "A longer string since these are variables lengths"
+String3$ = "This is string3 "
+String4$ = "joined to string4"
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteString( fileout, String1 )
+WriteString( fileout, String2 )
+WriteString( fileout, String3 + String4)
+WriteString( fileout, "Just to show you don't have to use variables" )
+
+; Close the file
+CloseFile( fileout )
+
+; Open the file to Read
+filein = ReadFile("mydata.dat")
+
+Read1$ = ReadString$( filein )
+Read2$ = ReadString$( filein )
+Read3$ = ReadString$( filein )
+Read4$ = ReadString$( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "String Variables Read From File - mydata.dat "
+Print
+Print Read1
+Print Read2
+Print Read3
+Print Read4
+
+WaitKey()
+
+
+
+
-Each string is stored in the file as a 4 byte (32bit) integer followed by the characters that form the string. The integer contains the number of characters in the string, i.e. its length. Note, that Carriage Return, Line
-Feed and Null characters are NOT use to indicate the end of the string. A file of strings cannot be read like a text file, since it contains string variables and not text. A null string, i.e. a string of zero length ("") is
-stored as 4 bytes, an integer count with a value = zero, followed by no Characters. Note strings are not limited to 255 characters as in some languages. Reading beyond the end of file does not result in an error, but each value read will be a zero length string.
+Index
; Reading and writing a file using ReadString$ and WriteString functions
-
-; Initialise some variables for the example
-String1$ = "A short string"
-String2$ = "A longer string since these are variables lengths"
-String3$ = "This is string3 "
-String4$ = "joined to string4"
-
-; Open a file to write to
-fileout = WriteFile("mydata.dat")
-
-; Write the information to the file
-WriteString( fileout, String1 )
-WriteString( fileout, String2 )
-WriteString( fileout, String3 + String4)
-WriteString( fileout, "Just to show you don't have to use variables" )
-
-; Close the file
-CloseFile( fileout )
-
-; Open the file to Read
-filein = ReadFile("mydata.dat")
-
-Read1$ = ReadString$( filein )
-Read2$ = ReadString$( filein )
-Read3$ = ReadString$( filein )
-Read4$ = ReadString$( filein )
-
-; Close the file once reading is finished
-CloseFile( fileout )
-
-Print "String Variables Read From File - mydata.dat "
-Print
-Print Read1
-Print Read2
-Print Read3
-Print Read4
-
-WaitKey()
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/2d_commands/Xor.htm b/_release/help/commands/2d_commands/Xor.htm
index 6efe7c6..4c0cde5 100644
--- a/_release/help/commands/2d_commands/Xor.htm
+++ b/_release/help/commands/2d_commands/Xor.htm
@@ -1,27 +1,63 @@
-Command: Xor Xor Definition:
Performs a bit level Exclusive OR between two values.
Parameter Description:
None.
Command Description:
Often used for lightweight (meaning worthless ;) encryption, this will take two values and perform an exclusive OR with each bit following the basic rules of XOR. The result can be XORed with one of the original numbers to reveal the other number. See the example for more.
Example:
num=%11110000111100001111000011110000 ; Define a bit pattern which is easy to recognize
+
+
+Blitz3D Docs
+
+
+
+
Xor
+
Parameters
+
+
+
+None.
+
+
+
+
Description
+
+
+
+Often used for lightweight (meaning worthless ;) encryption, this will take two values and perform an exclusive OR with each bit following the basic rules of XOR. The result can be XORed with one of the original numbers to reveal the other number. See the example for more.
-bitmask=Rnd(-2147483648,2147483647) ; Define a RANDOM Xor 32bit wide bitmask
-; This line prints the binary and decimal numbers before the Xor
-Print "Binary number is: "+Bin$(num)+" ("+num+")"
+See also: And, Or, Not.
+
+num=%11110000111100001111000011110000 ; Define a bit pattern which is easy to recognize
+
+bitmask=Rnd(-2147483648,2147483647) ; Define a RANDOM Xor 32bit wide bitmask
+
+; This line prints the binary and decimal numbers before the Xor
+Print "Binary number is: "+Bin$(num)+" ("+num+")"
+
+; This line prints the binary and decimal numbers of the Xor bitmask
+Print "Xor bitmask is: "+Bin$(bitmask)+" ("+bitmask+")"
+
+Print "------------------------------------------------------------------"
+
+; This line Xor's the number with the bitmask
+xres=num Xor bitmask
+
+; This line prints the binary and decimal numbers after the Xor
+Print "Xor result is: "+Bin$(xres)+" ("+xres+")"
+Print "------------------------------------------------------------------"
+
+; This line Xor's the Xor result with the bitmask again
+xres=xres Xor bitmask
+; This line prints the binary and decimal numbers after the second Xor. NOTE: This number is identical to the original number
+Print "Result Xor'ed again: "+Bin$(xres)+" ("+xres+")"
+
+WaitMouse ; Wait for the mouse before ending.
+
+
+
-; This line prints the binary and decimal numbers of the Xor bitmask
-Print "Xor bitmask is: "+Bin$(bitmask)+" ("+bitmask+")"
+Index
-Print "------------------------------------------------------------------"
-
-; This line Xor's the number with the bitmask
-xres=num Xor bitmask
-
-; This line prints the binary and decimal numbers after the Xor
-Print "Xor result is: "+Bin$(xres)+" ("+xres+")"
-Print "------------------------------------------------------------------"
-
-; This line Xor's the Xor result with the bitmask again
-xres=xres Xor bitmask
-; This line prints the binary and decimal numbers after the second Xor. NOTE: This number is identical to the original number
-Print "Result Xor'ed again: "+Bin$(xres)+" ("+xres+")"
-
-WaitMouse ; Wait for the mouse before ending.
-
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/AddAnimSeq.htm b/_release/help/commands/3d_commands/AddAnimSeq.htm
index 47197db..efe189e 100644
--- a/_release/help/commands/3d_commands/AddAnimSeq.htm
+++ b/_release/help/commands/3d_commands/AddAnimSeq.htm
@@ -1,40 +1,90 @@
-Command: AddAnimSeq
-
-
+Blitz3D Docs
+
-
-
-
AddAnimSeq ( entity,length)
-
-
-Parameters:
-
-
-
-
entity - entity handle
- length -
-
+
AddAnimSeq ( entity,length)
+
Parameters
+
+
+
+entity - entity handle
+length -
+
+
-
Description:
-
-
-
-
Creates an animation sequence for an entity. This must be done before
- any animation keys set by SetAnimKey can be
- used in an actual animation.
Returns the animation sequence number added.
-
+
Description
+
+
+
+Creates an animation sequence for an entity. This must be done before any animation keys set by SetAnimKey can be used in an actual animation however this is optional. You may use it to "bake" the frames you have added previously using SetAnimKey.
+
+Returns the animation sequence number added.
+
+;Create 3d animation example
+
+;Set up a simple nice looking level
+Graphics3D 640,480
+camera=CreateCamera()
+PositionEntity camera,0,12,-12
+RotateEntity camera,35,0,0
+light=CreateLight(2)
+PositionEntity light,1000,1000,-1000
+ground=CreatePlane(2)
+EntityAlpha ground,0.5
+EntityColor ground,0,0,255
+mirror=CreateMirror()
+
+;Lets make a bouncing ball that squashes on impact with the floor.
+ball=CreateSphere(16)
+EntityShininess ball,1
+EntityColor ball,255,0,0
+
+; Lets animate him and "record" the 3D animation for later playback
+bloat#=0 : flatten#=0 : ypos#=10
+
+For frame=1 To 10
+;Drop the ball from height 10 to 2
+ypos = ypos - spd#
+spd#=spd#+.2
+PositionEntity ball,0,ypos,0
+ScaleEntity ball,1+bloat,1+flatten,1+bloat
+
+;If the ball is low enough make it look increasingly squashed
+If frame>8
+bloat=bloat+1.5
+flatten=flatten-.25
+Else
+flatten=flatten+.05
+EndIf
+
+;Record the frame!
+SetAnimKey ball,frame
+Next
+
+;Now we need to add the frames we've just made to the sequence of "film"!
+seq = AddAnimSeq(ball,frame-1) ; total number of frames
+
+;Play it back ping-pong!
+Animate ball,2,0.15
+While Not KeyHit(1)
+UpdateWorld
+RenderWorld
+Flip
+Wend
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/AddTriangle.htm b/_release/help/commands/3d_commands/AddTriangle.htm
index d4050b6..daa4df8 100644
--- a/_release/help/commands/3d_commands/AddTriangle.htm
+++ b/_release/help/commands/3d_commands/AddTriangle.htm
@@ -1,55 +1,64 @@
-Command: AddTriangle
-
-
+Blitz3D Docs
+
-
-
-
AddTriangle ( surface,v0,v1,v2 )
-
-
-Parameters:
-
-
-
-
surface - surface handle
- v0 - index number of first vertex of triangle
- v1 - index number of second vertex of triangle
- v2 - index number of third vertex of triangle
-
+
AddTriangle ( surface,v0,v1,v2 )
+
Parameters
+
+
+
+surface - surface handle
+v0 - index number of first vertex of triangle
+v1 - index number of second vertex of triangle
+v2 - index number of third vertex of triangle
+
+
-
Description:
-
-
-
-
Adds a triangle to a surface and returns the triangle's index number,
- starting from 0.
The v0, v1 and v2 parameters are the index numbers of the
- vertices created using AddVertex.
-
Depending on how the vertices are arranged, then the triangle will only
- be visible from a certain side. Imagine that a triangle's vertex points are
- like dot-to-dot pattern, each numbered v0, v1, v2. If these dots, starting
- from v0, through to V2, form a clockwise pattern relative to the viewer,
- then the triangle will be visible. If these dots form an anti-clockwise
- pattern relative to the viewer, then the triangle will not be visible.
-
The reason for having one-sided triangles is that it reduces the amount
- of triangles that need to be rendered when one side faces the side of an
- object which won't be seen (such as the inside of a snooker ball). However, if you wish for a
- triangle to be two-sided, then you can either create two triangles, using
- the same set of vertex numbers for both but assigning them in opposite
- orders, or you can use CopyEntity and
- FlipMesh together.
-
+
Description
+
+
+
+Adds a triangle to a surface and returns the triangle's index number, starting from 0.
+
+The v0, v1 and v2 parameters are the index numbers of the vertices created using AddVertex.
+
+Depending on how the vertices are arranged, then the triangle will only be visible from a certain side. Imagine that a triangle's vertex points are like dot-to-dot pattern, each numbered v0, v1, v2. If these dots, starting from v0, through to V2, form a clockwise pattern relative to the viewer, then the triangle will be visible. If these dots form an anti-clockwise pattern relative to the viewer, then the triangle will not be visible.
+
+The reason for having one-sided triangles is that it reduces the amount of triangles that need to be rendered when one side faces the side of an object which won't be seen (such as the inside of a snooker ball). However, if you wish for a triangle to be two-sided, then you can either create two triangles, using the same set of vertex numbers for both but assigning them in opposite orders, or you can use CopyEntity and FlipMesh together.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/AddVertex.htm b/_release/help/commands/3d_commands/AddVertex.htm
index b136c21..b639255 100644
--- a/_release/help/commands/3d_commands/AddVertex.htm
+++ b/_release/help/commands/3d_commands/AddVertex.htm
@@ -1,63 +1,78 @@
-Command: AddVertex
-
-
+Blitz3D Docs
+
-
-
-
AddVertex ( surface,x#,y#,z#[,u#][,v#][,w#]
-)
-
-
-Parameters:
-
-
-
-
surface - surface handle
- x# - x coordinate of vertex
- y# - y coordinate of vertex
- z# - z coordinate of vertex
- u# (optional) - u texture coordinate of vertex
- v# (optional) - v texture coordinate of vertex
- w# (optional) - w texture coordinate of vertex - not used, included for
- future expansion
-
+
AddVertex ( surface,x#,y#,z#[,u#][,v#][,w#] )
+
Parameters
+
+
+
+surface - surface handle
+x# - x coordinate of vertex
+y# - y coordinate of vertex
+z# - z coordinate of vertex
+u# (optional) - u texture coordinate of vertex
+v# (optional) - v texture coordinate of vertex
+w# (optional) - w texture coordinate of vertex - not used, included for future expansion
+
+
-
Description:
-
-
-
-
Adds a vertex to the specified surface and returns the vertices' index
- number, starting from 0.
x,y,z are the geometric coordinates of the
- vertex, and u,v,w are texture mapping coordinates.
-
A vertex is a point in 3D space which is used to connect edges of a
- triangle together. Without any vertices, you can't have any triangles. At
- least three vertices are needed to create one triangle; one for each corner.
-
The optional u,v parameters allow you to specify texture coordinates for a vertex,
- which will determine how any triangle created using those vertices will be
- texture mapped.
-
This works on the following basis: the bottom left of an image has the uv
- coordinates 0,0. The bottom right has coordinates 0,1, top left 0,1 and top
- right 1,1. Now, depending on what uv coordinate you assign to the vertex,
- this will represent a point on the image. For example, a coordinate of
- 0.5,0.5 would represent the centre of the image.
-
So now imagine you have a normal equilateral triangle. By assigning
- the bottom left vertex a uv coordinate of 0,0, then bottom right a
- coordinate of 1,0 and the top centre 0.5,1, this will texture map the
- triangle with an image that fits it.
-
-
+
Description
+
+
+
+Adds a vertex to the specified surface and returns the vertices' index number, starting from 0.
+
+x,y,z are the geometric coordinates of the vertex, and u,v,w are texture mapping coordinates.
+
+A vertex is a point in 3D space which is used to connect edges of a triangle together. Without any vertices, you can't have any triangles. At least three vertices are needed to create one triangle; one for each corner.
+
+The optional u, v and w parameters allow you to specify texture coordinates for a vertex, which will determine how any triangle created using those vertices will be texture mapped. The u, v and w parameters specified will take effect on both texture coordinate sets (0 and 1). This works on the following basis:
+
+The top left of an image has the uv coordinates 0,0.
+The top right has coordinates 1,0
+The bottom right is 1,1.
+The bottom left 0,1.
+
+Thus, uv coordinates for a vertex correspond to a point in the image. For example, coordinates 0.9,0.1 would be near the upper right corner of the image.
+
+So now imagine you have a normal equilateral triangle. By assigning the bottom left vertex a uv coordinate of 0,0, the bottom right a coordinate of 1,0 and the top centre 0.5,1, this will texture map the triangle with an image that fits it.
+
+When adding a vertex its default color is 255,255,255,255.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/AlignToVector.htm b/_release/help/commands/3d_commands/AlignToVector.htm
index 5dcc2bc..daba1a1 100644
--- a/_release/help/commands/3d_commands/AlignToVector.htm
+++ b/_release/help/commands/3d_commands/AlignToVector.htm
@@ -1,45 +1,38 @@
-Command: AlignToVector
-
-
+Blitz3D Docs
+
-
-
-
+entity - entity handle
+vector_x# - vector x
+vector_y# - vector y
+vector_z# - vector z
+
+axis - axis of entity that will be aligned to vector
+1: x-axis
+2: y-axis
+3: z-axis
+
+rate# (optional) - rate at which entity is aligned from current orientation to vector orientation. Should be in the range 0 to 1, 0 for smooth transition and 1 for 'snap' transition. Defaults to 1.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/AmbientLight.htm b/_release/help/commands/3d_commands/AmbientLight.htm
index e8d39f9..b3c4545 100644
--- a/_release/help/commands/3d_commands/AmbientLight.htm
+++ b/_release/help/commands/3d_commands/AmbientLight.htm
@@ -1,93 +1,92 @@
-Command: AmbientLight
-
-
+Blitz3D Docs
+
-
-
-
AmbientLight red#,green#,blue#
-
-
-Parameters:
-
-
-
-
red# - red ambient light value
-green# - green ambient light value
-blue# - blue ambient light value
-
+
AmbientLight red#,green#,blue#
+
Parameters
+
+
+
+red# - red ambient light value
+green# - green ambient light value
+blue# - blue ambient light value
+
+The green, red and blue values should be in the range 0-255. The default ambient light colour is 127,127,127.
+
+
-
Description:
-
-
-
-
Sets the ambient lighting colour.
The green, red and blue values
- should be in the range 0-255. The default ambient light colour is
- 255,255,255.
+
Description
+
+
+
+Sets the ambient lighting colour.
+
+Ambient light is a light source that affects all points on a 3D object equally. So with ambient light only, all 3D objects will appear flat, as there will be no shading.
+
+Ambient light is useful for providing a certain level of light, before adding other lights to provide a realistic lighting effect.
+
+An ambient light level of 0,0,0 will result in no ambient light being displayed.
-Ambient light is a light source that affects all points on a 3D object equally.
-So with ambient light only, all 3D objects will appear flat, as there will be no
-shading.
-Ambient light is useful for providing a certain level of light, before adding
-other lights to provide a realistic lighting effect.
-
-An ambient light level of 0,0,0 will result in no ambient light being displayed.
entity - entity handle
-
- mode (optional) - mode of animation.
- 0: stop animation
- 1: loop animation (default)
- 2: ping-pong animation
- 3: one-shot animation
-
- speed# (optional) - speed of animation. Defaults to 1.
- sequence (optional) - specifies which sequence of animation frames to play.
- Defaults to 0.
- transition# (optional) - used to tween between an entities current position
- rotation and the first frame of animation. Defaults to 0.
+entity - entity handle
+
+mode (optional) - mode of animation.
+0: stop animation
+1: loop animation (default)
+2: ping-pong animation
+3: one-shot animation
+
+speed# (optional) - speed of animation. Defaults to 1.
+sequence (optional) - specifies which sequence of animation frames to play. Defaults to 0.
+transition# (optional) - used to tween between an entities current position rotation and the first frame of animation. Defaults to 0.
+
+
-
Description:
-
-
-
-
Animates an entity.
More info about the optional parameters:
-
speed# - a negative speed will play the animation backwards.
-
sequence - Initially, an entity loaded with
- LoadAnimMesh will have a single animation sequence. More sequences can
- be added using either LoadAnimSeq or
- AddAnimSeq. Animation sequences are numbered
- 0,1,2...etc.
-
transition# - A value of 0 will cause an instant 'leap' to the first
- frame, while values greater than 0 will cause a smooth transition.
-
+
Description
+
+
+
+Animates an entity.
+
+More info about the optional parameters:
+
+speed# - a negative speed will play the animation backwards.
+
+sequence - Initially, an entity loaded with LoadAnimMesh will have a single animation sequence. More sequences can be added using either LoadAnimSeq or AddAnimSeq. Animation sequences are numbered 0,1,2...etc.
+
+transition# - A value of 0 will cause an instant 'leap' to the first frame, while values greater than 0 will cause a smooth transition.
+
speed# (optional) - speed of animation. Defaults to 1.
- first_frame (optional) - first frame of animation. Defaults to 1.
- last_frame# (optional) - last frame of animation. Defaults to last frame of
- all md2 animations.
+md2 - md2 handle
+
+mode (optional) - mode of animation
+0: stop animation
+1: loop animation (default)
+2: ping-pong animation
+3: one-shot animation
+
+speed# (optional) - speed of animation. Defaults to 1.
+first_frame (optional) - first frame of animation. Defaults to 1.
+last_frame# (optional) - last frame of animation. Defaults to last frame of all md2 animations.
+transition# (optional) - smoothness of transition between last frame shown of previous animation and first frame of next animation. Defaults to 0.
+
+
-
Description:
-
-
-
-
Starts an md2 entity animating.
The md2 will actually move from one
- frame to the next when UpdateWorld is called,
- usually once per main loop.
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/AntiAlias.htm b/_release/help/commands/3d_commands/AntiAlias.htm
index c4da646..a321f82 100644
--- a/_release/help/commands/3d_commands/AntiAlias.htm
+++ b/_release/help/commands/3d_commands/AntiAlias.htm
@@ -1,79 +1,73 @@
-Command: AntiAlias
-
-
+Blitz3D Docs
+
-
-
-
Antialias enable
-
-
-Parameters:
-
-
-
-
enable - true to enable fullscreen antialiasing, false to disable. Defaults
-to false.
-
+
AntiAlias
+
Parameters
+
+
+
+enable - True to enable fullscreen antialiasing, False to disable.
+
+The default AntiAlias mode is False.
+
+
+
+
Description
+
+
+
+Enables or disables fullscreen antialiasing.
+
+Fullscreen antialiasing is a technique used to smooth out the entire screen, so that jagged lines are made less noticeable.
+
+Some 3D cards have built-in support for fullscreen antialiasing, which should allow you to enable the effect without much slowdown. However, for cards without built-in support for fullscreen antialiasing, enabling the effect may cause severe slowdown.
+
+; AntiAlias Example
+; -----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+sphere=CreateSphere()
+PositionEntity sphere,0,0,2
+
+While Not KeyDown( 1 )
+
+; Toggle antialias enable value between true and false when spacebar is pressed
+If KeyHit( 57 )=True Then enable=1-enable
+
+; Enable/disable antialiasing
+AntiAlias enable
+
+RenderWorld
+
+Text 0,0,"Press spacebar to toggle between AntiAlias True/False"
+If enable=True Then Text 0,20,"AntiAlias True" Else Text 0,20,"AntiAlias False"
+
+Flip
+
+Wend
+
+End
+
+
-
Description:
-
-
-
-
Enables or disables fullscreen antialiasing.
-Fullscreen antialiasing is a technique used to smooth out the entire screen, so
-that jagged lines are made less noticeable.
+Index
-Some 3D cards have built-in support for fullscreen antialiasing, which should
-allow you to enable the effect without much slowdown. However, for cards without
-built-in support for fullscreen antialiasing, enabling the effect may cause
-severe slowdown.
The alpha# value should be in the range 0-1.
- The default brush alpha setting is 1.
The alpha level is how
- transparent an entity is. A value of 1 will mean the entity is
- non-transparent, i.e. opaque. A value of 0 will mean the entity is
- completely transparent, i.e. invisible. Values between 0 and 1 will cause
- varying amount of transparency accordingly, useful for imitating the look of
- objects such as glass and ice.
-
An BrushAlpha value of 0 is especially useful as Blitz3D will not render
- entities with such a value, but will still involve the entities in collision
- tests. This is unlike
- HideEntity, which doesn't involve entities in
- collisions.
-
+
Description
+
+
+
+Sets the alpha level of a brush.
+
+The alpha# value should be in the range 0-1. The default brush alpha setting is 1.
+
+The alpha level is how transparent an entity is. A value of 1 will mean the entity is non-transparent, i.e. opaque. A value of 0 will mean the entity is completely transparent, i.e. invisible. Values between 0 and 1 will cause varying amount of transparency accordingly, useful for imitating the look of objects such as glass and ice.
+
+An BrushAlpha value of 0 is especially useful as Blitz3D will not render entities with such a value, but will still involve the entities in collision tests. This is unlike HideEntity, which doesn't involve entities in collisions.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/BrushBlend.htm b/_release/help/commands/3d_commands/BrushBlend.htm
index 4ada882..7e3f3e6 100644
--- a/_release/help/commands/3d_commands/BrushBlend.htm
+++ b/_release/help/commands/3d_commands/BrushBlend.htm
@@ -1,41 +1,32 @@
-Command: BrushBlend
-
-
+Blitz3D Docs
+
-
-
-
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/BrushColor.htm b/_release/help/commands/3d_commands/BrushColor.htm
index c8c0fde..cbf46f8 100644
--- a/_release/help/commands/3d_commands/BrushColor.htm
+++ b/_release/help/commands/3d_commands/BrushColor.htm
@@ -1,87 +1,86 @@
-Command: BrushColor
-
-
+Blitz3D Docs
+
-
-
-
BrushColor brush,red#,green#,blue#
-
-
-Parameters:
-
-
-
-
brush - brush handle
- red# - brush red value
- green# - brush green value
- blue# - brush blue value
-
+
BrushColor brush,red#,green#,blue#
+
Parameters
+
+
+
+brush - brush handle
+red# - red value of brush
+green# - green value of brush
+blue# - blue value of brush
+
+
-
Description:
-
-
-
-
Sets the colour of a brush.
The green, red and blue values should be in
- the range 0-255. The default brush color is
- 255,255,255.
Please note that if EntityFX or
- BrushFX flag 2 is being used, brush colour will have no effect and vertex
- colours will be used instead.
-
+
Description
+
+
+
+Sets the colour of a brush.
+
+The green, red and blue values should be in the range 0-255. The default brush color is 255,255,255.
+
+Please note that if EntityFX or BrushFX flag 2 is being used, brush colour will have no effect and vertex colours will be used instead.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/BrushFX.htm b/_release/help/commands/3d_commands/BrushFX.htm
index 682bc00..4eef3d7 100644
--- a/_release/help/commands/3d_commands/BrushFX.htm
+++ b/_release/help/commands/3d_commands/BrushFX.htm
@@ -1,45 +1,38 @@
-Command: BrushFX
-
-
+Blitz3D Docs
+
-
-
-
BrushFX brush,fx
-
-
-Parameters:
-
-
-
-
brush - brush handle
-
- fx -
- 1: full-bright
- 2: use vertex colors instead of brush color
- 4: flatshaded
- 8: disable fog
-
+
BrushFX brush,fx
+
Parameters
+
+
+
+brush - brush handle
+
+fx -
+0: nothing (default)
+1: full-bright
+2: use vertex colors instead of brush color
+4: flatshaded
+8: disable fog
+16: disable backface culling
+
+
-
Description:
-
-
-
-
Sets miscellaneous effects for a brush.
Flags can be added to combine
- two or more effects. For example, specifying a flag of 3 (1+2) will result
- in a full-bright and vertex-coloured brush.
-
+
Description
+
+
+
+Sets miscellaneous effects for a brush.
+
+Flags can be added to combine two or more effects. For example, specifying a flag of 3 (1+2) will result in a full-bright and vertex-coloured brush.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/BrushShininess.htm b/_release/help/commands/3d_commands/BrushShininess.htm
index 6d813c1..9af5fe5 100644
--- a/_release/help/commands/3d_commands/BrushShininess.htm
+++ b/_release/help/commands/3d_commands/BrushShininess.htm
@@ -1,43 +1,35 @@
-Command: BrushShininess
-
-
+Blitz3D Docs
+
-
-
-
BrushShininess brush,shininess#
-
-
-Parameters:
-
-
-
-
brush - brush handle
- shininess# - shininess of brush
-
+
BrushShininess brush,shininess#
+
Parameters
+
+
+
+brush - brush handle
+shininess# - shininess of brush
+
+
-
Description:
-
-
-
-
Sets the specular shininess of a brush.
The shininess# value should be in the range 0-1.
- The default shininess setting is 0.
Shininess is how much brighter certain
- areas of an object will appear to be when a light is shone directly at them.
-
Setting a shininess value of 1 for a medium to high poly sphere, combined
- with the creation of a light shining in the direction of it, will give it
- the appearance of a shiny snooker ball.
-
+
Description
+
+
+
+Sets the specular shininess of a brush.
+
+The shininess# value should be in the range 0-1. The default shininess setting is 0.
+
+Shininess is how much brighter certain areas of an object will appear to be when a light is shone directly at them.
+
+Setting a shininess value of 1 for a medium to high poly sphere, combined with the creation of a light shining in the direction of it, will give it the appearance of a shiny snooker ball.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/BrushTexture.htm b/_release/help/commands/3d_commands/BrushTexture.htm
index 298c37d..cfdeb12 100644
--- a/_release/help/commands/3d_commands/BrushTexture.htm
+++ b/_release/help/commands/3d_commands/BrushTexture.htm
@@ -1,91 +1,89 @@
-Command: BrushTexture
-
-
+Blitz3D Docs
+
-
-
-
BrushTexture brush,texture[,frame][,index]
-
-
-Parameters:
-
-
-
-
brush - brush handle
- texture - texture handle
- frame (optional) - texture frame. Defaults to 0.
- index (optional) - texture index. Defaults to 0.
The optional
- frame parameter specifies which animation frame, if any exist, should be
- assigned to the brush.
-
The optional index parameter specifies texture layer that the texture
- should be assigned to. Brushes have up to four texture layers, 0-3
- inclusive.
-
+
Description
+
+
+
+Assigns a texture to a brush.
+
+The optional frame parameter specifies which animation frame, if any exist, should be assigned to the brush.
+
+The optional index parameter specifies texture layer that the texture should be assigned to. Brushes have up to four texture layers, 0-3 inclusive.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CameraClsColor.htm b/_release/help/commands/3d_commands/CameraClsColor.htm
index 825e387..c5340a5 100644
--- a/_release/help/commands/3d_commands/CameraClsColor.htm
+++ b/_release/help/commands/3d_commands/CameraClsColor.htm
@@ -1,40 +1,77 @@
-Command: CameraClsColor
-
-
+Blitz3D Docs
+
-
-
-
CameraClsColor camera,red#,green#,blue#
-
-
-Parameters:
-
-
-
-
camera - camera handle
- red# - red value of camera background color
- green# - green value of camera background color
- blue# - blue value of camera background color
-
+
CameraClsColor camera,red#,green#,blue#
+
Parameters
+
+
+
+camera - camera handle
+red# - red value of camera background color
+green# - green value of camera background color
+blue# - blue value of camera background color
+
+
-
Description:
-
-
-
-
Sets camera background color. Defaults to 0,0,0.
-
+
Description
+
+
+
+Sets camera background color. Defaults to 0,0,0.
+
+; CameraClsMode Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+ground_tex=LoadTexture("media/MossyGround.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+PositionEntity cube,0,1,0
+
+; Load 2D background image
+background=LoadImage("media/sky.bmp")
+
+; Use red ink color so we can see text on top of black or light blue background
+Color 255,0,0
+
+While Not KeyDown(1)
+
+If KeyDown(205)=True Then TurnEntity camera,0,-1,0
+If KeyDown(203)=True Then TurnEntity camera,0,1,0
+If KeyDown(208)=True Then MoveEntity camera,0,0,-0.05
+If KeyDown(200)=True Then MoveEntity camera,0,0,0.05
+
+; Toggle cls_color value between 0 and 1 when spacebar is pressed
+If KeyHit(57)=True Then cls_color=1-cls_color
+
+; Set the camera clear mode, using the cls_color value
+CameraClsMode camera,cls_color,1
+
+; Draw a 2D background. When cls_color is set to 0, the 2D graphics will show behind the 3D graphics.
+TileBlock background,0,0
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press space bar to enable/disable colour clearing"
+Text 0,40,"CameraClsMode camera,"+cls_color+","+1
+
+Flip
+
+Wend
+
+End
+
plane=CreatePlane()
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture plane,grass_tex
-
- ; Set camera fog to 1 (linear fog)
- CameraFogMode camera,1
-
- ; Set camera fog range
- CameraFogRange camera,1,10
-
- ; Set initial fog colour values
- red#=0
- green#=0
- blue#=0
-
- While Not KeyDown( 1 )
-
- ; Change red, green, blue values depending on key pressed
- If KeyDown( 2 )=True And red#>0 Then red#=red#-1
- If KeyDown( 3 )=True And red#<255 Then red#=red#+1
- If KeyDown( 4 )=True And green#>0 Then green#=green#-1
- If KeyDown( 5 )=True And green#<255 Then green#=green#+1
- If KeyDown( 6 )=True And blue#>0 Then blue#=blue#-1
- If KeyDown( 7 )=True And blue#<255 Then blue#=blue#+1
-
- ; Set camera fog color using red, green, blue values
- CameraFogColor camera,red#,green#,blue#
-
- If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
- If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
- If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the infinite plane"
- Text 0,20,"Press keys 1-6 to change CameraFogColor red#,green#,blue# values
- Text 0,40,"Fog Red: "+red#
- Text 0,60,"Fog Green: "+green#
- Text 0,80,"Fog Blue: "+blue#
-
- Flip
-
- Wend
-
- End
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CameraFogMode.htm b/_release/help/commands/3d_commands/CameraFogMode.htm
index b6efc1e..c38d520 100644
--- a/_release/help/commands/3d_commands/CameraFogMode.htm
+++ b/_release/help/commands/3d_commands/CameraFogMode.htm
@@ -1,88 +1,83 @@
-Command: CameraFogMode
-
-
+Blitz3D Docs
+
-
-
-
CameraFogMode camera,mode
-
-
-Parameters:
-
-
-
-
camera - sets camera fog mode
- mode - fog mode
- 0: no fog
- 1: linear fog
-
+
CameraFogMode camera,mode
+
Parameters
+
+
+
+camera - camera handle
+
+mode -
+0: no fog (default)
+1: linear fog
+
+
-
Description:
-
-
-
-
Sets the camera fog mode.
This will enable/disable fogging, a
- technique used to gradually fade out graphics the further they are away from
- the camera. The can be used to avoid 'pop-up', the moment at which 3D
- objects suddenly appear on the horizon.
-
The default fog color is black and the default fog range is 1-1000,
- although these can be changed by using
- CameraFogColor and CameraFogRange
- respectively.
-
Each camera can have its own fog mode, for multiple on-screen fog
- effects.
-
+
Description
+
+
+
+Sets the camera fog mode.
+
+This will enable/disable fogging, a technique used to gradually fade out graphics the further they are away from the camera. This can be used to avoid 'pop-up', the moment at which 3D objects suddenly appear on the horizon.
+
+The default fog colour is black and the default fog range is 1-1000, although these can be changed by using CameraFogColor and CameraFogRange respectively.
+
+Each camera can have its own fog mode, for multiple on-screen fog effects.
+
; CameraFogMode Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,0,1,0
- CameraFogRange camera,1,10
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- plane=CreatePlane()
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture plane,grass_tex
-
- While Not KeyDown( 1 )
-
- ; Toggle camera fog mode between 0 and 1 when spacebar is pressed
- If KeyHit( 57 )=True Then fog_mode=1-fog_mode : CameraFogMode
- camera,fog_mode
-
- If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
- If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
- If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the infinite plane"
- Text 0,20,"Press spacebar to toggle between CameraFogMode 0/1"
- If fog_mode=False Then Text 0,40,"CameraFogMode 0" Else Text
- 0,40,"CameraFogMode 1"
-
- Flip
-
- Wend
-
- End
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CameraFogRange.htm b/_release/help/commands/3d_commands/CameraFogRange.htm
index b24ad2c..e6e4830 100644
--- a/_release/help/commands/3d_commands/CameraFogRange.htm
+++ b/_release/help/commands/3d_commands/CameraFogRange.htm
@@ -1,90 +1,88 @@
-Command: CameraFogRange
-
-
+Blitz3D Docs
+
-
-
-
CameraFogRange camera,near#,far#
-
-
-Parameters:
-
-
-
-
camera - camera handle
- near# - distance in front of camera that fog starts
- far# - distance in front of camera that fog ends
-
+
CameraFogRange camera,near#,far#
+
Parameters
+
+
+
+camera - camera handle
+near# - distance in front of camera that fog starts
+far# - distance in front of camera that fog ends
+
+
-
Description:
-
-
-
-
Sets camera fog range.
The near parameter specifies at what distance
- in front of the camera that the fogging effect will start; all 3D object
- before this point will not be faded.
-
The far parameter specifies at what distance in front of the camera that
- the fogging effect will end; all 3D objects beyond this point will be
- completely faded out.
-
+
Description
+
+
+
+Sets camera fog range.
+
+The near parameter specifies at what distance in front of the camera that the fogging effect will start; all 3D object before this point will not be faded.
+
+The far parameter specifies at what distance in front of the camera that the fogging effect will end; all 3D objects beyond this point will be completely faded out.
+
; CameraFogRange Example
- ; ----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,0,1,0
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- plane=CreatePlane()
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture plane,grass_tex
-
- ; Set camera fog to 1 (linear fog)
- CameraFogMode camera,1
-
- ; Set intial fog range value
- fog_range=10
-
- While Not KeyDown( 1 )
-
- ; If square brackets keys pressed then change fog range value
- If KeyDown( 26 )=True Then fog_range=fog_range-1
- If KeyDown( 27 )=True Then fog_range=fog_range+1
-
- ; Set camera fog range
- CameraFogRange camera,1,fog_range
-
- If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
- If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
- If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the infinite plane"
- Text 0,20,"Press [ or ] to change CameraFogRange value"
- Text 0,40,"CameraFogRange camera,1,"+fog_range
-
- Flip
-
- Wend
-
- End
+; CameraFogRange Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,0
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture plane,grass_tex
+
+; Set camera fog to 1 (linear fog)
+CameraFogMode camera,1
+
+; Set intial fog range value
+fog_range=10
+
+While Not KeyDown( 1 )
+
+; If square brackets keys pressed then change fog range value
+If KeyDown( 26 )=True Then fog_range=fog_range-1
+If KeyDown( 27 )=True Then fog_range=fog_range+1
+
+; Set camera fog range
+CameraFogRange camera,1,fog_range
+
+If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
+If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
+If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the infinite plane"
+Text 0,20,"Press [ or ] to change CameraFogRange value"
+Text 0,40,"CameraFogRange camera,1,"+fog_range
+
+Flip
+
+Wend
+
+End
+
Picks the entity positioned at the specified viewport coordinates.
- Returns the entity picked, or 0 if none there.
-
An entity must have its EntityPickMode
- set to a non-0 value value to be 'pickable'.
-
+
Description
+
+
+
+Picks the entity positioned at the specified viewport coordinates.
+
+Returns the entity picked, or 0 if none there.
+
+An entity must have its EntityPickMode set to a non-0 value value to be 'pickable'.
+
+
+See also: EntityPick, LinePick, CameraPick, EntityPickMode.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CameraProject.htm b/_release/help/commands/3d_commands/CameraProject.htm
index 062a9e7..c2ffdff 100644
--- a/_release/help/commands/3d_commands/CameraProject.htm
+++ b/_release/help/commands/3d_commands/CameraProject.htm
@@ -1,41 +1,91 @@
-Command: CameraProject
-
-
+Blitz3D Docs
+
-
-
-
CameraProject ( camera,x#,y#,z# )
-
-
-Parameters:
-
-
-
-
camera - camera handle
- x# - world coordinate x
- y# - world coordinate y
- z# - world coordinate z
-
+
CameraProject camera,x#,y#,z#
+
Parameters
+
+
+
+camera - camera handle
+x# - world coordinate x
+y# - world coordinate y
+z# - world coordinate z
+
+
-
Description:
-
-
-
-
Projects the world coordinates x,y,z on to the 2D screen. Returns true
- if the coordinates are on-screen.
-
+
Description
+
+
+
+Projects the world coordinates x,y,z on to the 2D screen.
+
+; CameraProject Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+cube_tex=LoadTexture("media/b3dlogo.jpg")
+EntityTexture cube,cube_tex
+PositionEntity cube,0,1,0
+
+While Not KeyDown( 1 )
+
+If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
+If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
+If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
+
+; Use camera project to get 2D coordinates from 3D coordinates of cube
+CameraProject(camera,EntityX(cube),EntityY(cube),EntityZ(cube))
+
+RenderWorld
+
+; If cube is in view then draw text, if not then draw nothing otherwise text will be drawn at 0,0
+If EntityInView(cube,camera)=True
+
+; Use ProjectedX() and ProjectedY() to get 2D coordinates from when CameraProject was used.
+; Use these coordinates to draw text at a 2D position, on top of a 3D scene.
+Text ProjectedX#(),ProjectedY#(),"Cube"
+
+EndIf
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"ProjectedX: "+ProjectedX#()
+Text 0,40,"ProjectedY: "+ProjectedY#()
+Text 0,60,"ProjectedZ: "+ProjectedZ#()
+Text 0,80,"EntityInView: "+EntityInView(cube,camera)
+
+Flip
+
+Wend
+
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CameraRange.htm b/_release/help/commands/3d_commands/CameraRange.htm
index 21fde22..a42f375 100644
--- a/_release/help/commands/3d_commands/CameraRange.htm
+++ b/_release/help/commands/3d_commands/CameraRange.htm
@@ -1,40 +1,83 @@
-Command: CameraRange
-
-
+Blitz3D Docs
+
-
-
-
CameraRange camera,near#,far#
-
-
-Parameters:
-
-
-
-
camera - camera handle
- near - distance in front of camera that 3D objects start being drawn
- far - distance in front of camera that 3D object stop being drawn
-
+
CameraRange camera,near#,far#
+
Parameters
+
+
+
+camera - camera handle
+near - distance in front of camera that 3D objects start being drawn
+far - distance in front of camera that 3D object stop being drawn
+
+
-
Description:
-
-
-
-
Sets camera range.
Try and keep the ratio of far/near as small as
- possible for optimal z-buffer performance. Defaults to 1,1000.
-
+
Description
+
+
+
+Sets camera range.
+
+Try and keep the ratio of far/near as small as possible for optimal z-buffer performance. Defaults to 1,1000.
+
+; CameraRange Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,0
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+grass_tex=LoadTexture("media/mossyground.bmp")
+EntityTexture plane,grass_tex
+
+; Set intial camera range value
+cam_range=10
+
+While Not KeyDown( 1 )
+
+; If square brackets keys pressed then change camera range value
+If KeyDown(26)=True Then cam_range=cam_range-1
+If KeyDown(27)=True Then cam_range=cam_range+1
+
+; Set camera range
+CameraRange camera,1,cam_range
+
+If KeyDown(205)=True Then TurnEntity camera,0,-1,0
+If KeyDown(203)=True Then TurnEntity camera,0,1,0
+If KeyDown(208)=True Then MoveEntity camera,0,0,-0.05
+If KeyDown(200)=True Then MoveEntity camera,0,0,0.05
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the infinite plane"
+Text 0,20,"Press [ or ] to change CameraRange value"
+Text 0,40,"CameraRange camera,1,"+cam_range
+
+Flip
+
+Wend
+
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CameraViewport.htm b/_release/help/commands/3d_commands/CameraViewport.htm
index 6453df1..3ec7a17 100644
--- a/_release/help/commands/3d_commands/CameraViewport.htm
+++ b/_release/help/commands/3d_commands/CameraViewport.htm
@@ -1,88 +1,85 @@
-Command: CameraViewport
-
-
+Blitz3D Docs
+
-
-
-
CameraViewport camera,x,y,width,height
-
-
-Parameters:
-
-
-
-
camera - camera handle
- x - x coordinate of top left hand corner of viewport
- y - y coordinate of top left hand corner of viewport
- width - width of viewport
- height - height of viewport
-
+
CameraViewport camera,x,y,width,height
+
Parameters
+
+
+
+camera - camera handle
+x - x coordinate of top left hand corner of viewport
+y - y coordinate of top left hand corner of viewport
+width - width of viewport
+height - height of viewport
+
+
-
Description:
-
-
-
-
Sets the camera viewport position and size.
The camera viewport is the
- area of the 2D screen that the 3D graphics as viewed by the camera are
- displayed in.
-
Setting the camera viewport allows you to achieve spilt-screen and
- rear-view mirror effects.
-
+
Description
+
+
+
+Sets the camera viewport position and size.
+
+The camera viewport is the area of the 2D screen that the 3D graphics as viewed by the camera are displayed in.
+
+Setting the camera viewport allows you to achieve spilt-screen and rear-view mirror effects.
+
; CameraViewport Example
- ; ----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- ; Create first camera
- cam1=CreateCamera()
-
- ; Set the first camera's viewport so that it fills the top half of the
- camera
- CameraViewport cam1,0,0,GraphicsWidth(),GraphicsHeight()/2
-
- ; Create second camera
- cam2=CreateCamera()
-
- ; Set the second camera's viewport so that it fills the bottom half of the
- camera
- CameraViewport cam2,0,GraphicsHeight()/2,GraphicsWidth(),GraphicsHeight()/2
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- plane=CreatePlane()
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture plane,grass_tex
- PositionEntity plane,0,-1,0
-
- While Not KeyDown( 1 )
-
- If KeyDown( 205 )=True Then TurnEntity cam1,0,-1,0
- If KeyDown( 203 )=True Then TurnEntity cam1,0,1,0
- If KeyDown( 208 )=True Then MoveEntity cam1,0,0,-0.05
- If KeyDown( 200 )=True Then MoveEntity cam1,0,0,0.05
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move the first camera about the infinite plane"
-
- Flip
-
- Wend
-
- End
+; CameraViewport Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+; Create first camera
+cam1=CreateCamera()
+
+; Set the first camera's viewport so that it fills the top half of the camera
+CameraViewport cam1,0,0,GraphicsWidth(),GraphicsHeight()/2
+
+; Create second camera
+cam2=CreateCamera()
+
+; Set the second camera's viewport so that it fills the bottom half of the camera
+CameraViewport cam2,0,GraphicsHeight()/2,GraphicsWidth(),GraphicsHeight()/2
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture plane,grass_tex
+PositionEntity plane,0,-1,0
+
+While Not KeyDown( 1 )
+
+If KeyDown( 205 )=True Then TurnEntity cam1,0,-1,0
+If KeyDown( 203 )=True Then TurnEntity cam1,0,1,0
+If KeyDown( 208 )=True Then MoveEntity cam1,0,0,-0.05
+If KeyDown( 200 )=True Then MoveEntity cam1,0,0,0.05
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move the first camera about the infinite plane"
+
+Flip
+
+Wend
+
+End
+
+; CreateZoom Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,0
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+ground=CreatePlane()
+sand_tex=LoadTexture("media/sand.bmp")
+ScaleTexture sand_tex,10,10
+EntityTexture ground,sand_tex
+EntityColor ground,168,133,55
+
+cactus1=LoadMesh("media/CACTUS2.x")
+cactus2=LoadMesh("media/CACTUS2.x")
+camel=LoadMesh("media/camel.x")
+PositionEntity cactus1,-1,2,10
+PositionEntity cactus2,1,2,10
+PositionEntity camel,0,1,1000
+
+; Set initial zoom value
+zoom#=1
+
+While Not KeyDown( 1 )
+
+If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
+If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
+
+; Change zoom value depending on key pressed
+If KeyDown( 208 )=True Then zoom#=zoom#-0.1
+If KeyDown( 200 )=True Then zoom#=zoom#+0.1
+
+; Put a minimum and maximum cap on zoom value
+If zoom#<1 Then zoom#=1
+If zoom#>100 Then zoom#=100
+
+; Set camera zoom
+CameraZoom camera,zoom#
+
+RenderWorld
+
+Text 0,0,"Use left and right cursor keys to turn around"
+Text 0,20,"Use up and down cursor keys to change camera zoom"
+Text 0,40,"There is a camel on the horizon, inbetween the cacti. Zoom in to see it."
+Text 0,60,"CameraZoom camera,"+zoom#
+
+Flip
+
+Wend
+
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CaptureWorld.htm b/_release/help/commands/3d_commands/CaptureWorld.htm
index 9476af1..2b3bbe0 100644
--- a/_release/help/commands/3d_commands/CaptureWorld.htm
+++ b/_release/help/commands/3d_commands/CaptureWorld.htm
@@ -1,41 +1,85 @@
-Command: CaptureWorld
-
-
+Blitz3D Docs
+
-
-
-
CaptureWorld
-
-
-Parameters:
-
-
-
-
None.
-
+
CaptureWorld
+
Parameters
+
+
+
+None.
+
+
-
Description:
-
-
-
-
Takes a snapshot of the position and orientation of each entity in the
- world.
This snapshot can then be used with
- RenderWorld to render entities at a point somewhere between their
- captured position and their current position. See
- RenderWorld for more about how and why this is done.
-
+
Description
+
+
+
+CaptureWorld 'captures' the properties (position, rotation, scale, alpha etc) of each entity in the 3D world.
+
+This is then used in conjunction with the RenderWorld tween parameter in order to render an interpolated frame between the captured state of each entity and the current state of each entity. See the RenderWorld docs for a full explanation of render tweening.
+
+
+See also: RenderWorld.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/ClearCollisions.htm b/_release/help/commands/3d_commands/ClearCollisions.htm
index ea8f9ef..fe143d5 100644
--- a/_release/help/commands/3d_commands/ClearCollisions.htm
+++ b/_release/help/commands/3d_commands/ClearCollisions.htm
@@ -1,104 +1,100 @@
-Command: ClearCollisions
-
-
+Blitz3D Docs
+
-
-
-
ClearCollisions
-
-
-Parameters:
-
-
-
-
None.
-
+
ClearCollisions
+
Parameters
+
+
+
+None.
+
+
-
Description:
-
-
-
-
Clears the collision information list.
Whenever you use the
- Collisions command to enable collisions between
- two different entity types, information is added to the collision list.
- This command clears that list, so that no collisions will be detected until
- the Collisions command is used again.
-
The command will not clear entity collision information. For example,
- entity radius, type etc.
-
+
Description
+
+
+
+Clears the collision information list.
+
+Whenever you use the Collisions command to enable collisions between two different entity types, information is added to the collision list. This command clears that list, so that no collisions will be detected until the Collisions command is used again.
+
+The command will not clear entity collision information. For example, entity radius, type etc.
+
surface - surface handle
- clear_verts (optional) - true to remove all vertices from the specified surface,
- false not to.
- Defaults to true.
- clear_triangles (optional) - true to remove all triangles from the specified surface,
- false not to. Defaults to
- true.
+surface - surface handle
+clear_verts (optional) - true to remove all vertices from the specified surface, false not to. Defaults to true.
+clear_triangles (optional) - true to remove all triangles from the specified surface, false not to. Defaults to true.
+
+
-
Description:
-
-
-
-
Removes all vertices and/or triangles from a surface.
This
- is useful for deleting sections of mesh. The results will be instantly
- visible.
-
After deleting a surface, you may wish to create it again but with a
- slightly different polygon count for dynamic level of detail (LOD).
-
-
+
Description
+
+
+
+Removes all vertices and/or triangles from a surface.
+
+This is useful for clearing sections of mesh. The results will be instantly visible.
+
+After clearing a surface, you may wish to add vertices and triangles to it again but with a slightly different polygon count for dynamic level of detail (LOD).
+
+; ClearTextureFilters and TextureFilter Example.
+; ----------------------------------------------
+
+Const tex_color = 1 ; Color texture
+Const tex_alpha = 2 ; Alpha texture (Include alpha channel data)
+Const tex_mask = 4 ; Masked texture (black is transparent)
+Const tex_mipmap = 8 ; Create texture mipmaps
+Const tex_clampu = 16 ; Restrict U texture coords from "bleeding over"
+Const tex_clampv = 32 ; Restrict V texture coords from "bleeding over"
+Const tex_envshpere = 64 ; Load texture as a spherical environment map
+Const tex_vram = 256 ; Force texture graphics to vram
+Const tex_highcolor = 512 ; Forces texture graphics to be 32-bits per pixel
+
+Graphics3D 640,480
+
+; Removes any texture filters that might apply.
+
+ClearTextureFilters
+
+; Add an alpha texture to the list of
+; texture filters to apply to files
+; that have "_alpha" in their filenames.
+
+TextureFilter "_alpha",tex_color + tex_alpha + tex_mipmap
+
+; Set appropriate texture flags for loading
+; suitable skybox textures from files named
+; something with "_skybox".
+
+TextureFilter "_skybox", tex_color + tex_mipmap + tex_clampu + tex_clampv
+
+; Set the flags for loading a spherical refletction
+; map to apply to all "_refmap" files.
+
+TextureFilter "_refmap", tex_color + tex_mipmap + tex_envshpere
+
+; Setup a texture filter to allow faster
+; (and easier) pixel manipulation on all
+; loaded "_fastblit" files.
+
+TextureFilter "_fastblit", tex_color + tex_vram + tex_highcolor
+
+; This is where you would normally load your special
+; textures.
+
+; The next bit resets the texture filters to their
+; standard settings.
+
+ClearTextureFilters
+TextureFilter "", tex_color + tex_mipmap
+
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/ClearWorld.htm b/_release/help/commands/3d_commands/ClearWorld.htm
index 42d0245..3736946 100644
--- a/_release/help/commands/3d_commands/ClearWorld.htm
+++ b/_release/help/commands/3d_commands/ClearWorld.htm
@@ -1,42 +1,34 @@
-Command: TFormNormal
-
-
+Blitz3D Docs
+
-
-
-
ClearWorld [entities][,brushes][,textures]
-
-
-Parameters:
-
-
-
-
None.
-
+
ClearWorld [entities][,brushes][,textures]
+
Parameters
+
+
+
+entities (optional) - True to clear all entities, False not to. Defaults to true.
+brushes (optional) - True to clear all brushes, False not to. Defaults to true.
+textures (optional) - True to clear all textures, False not to. Defaults to true.
+
+
-
Description:
-
-
-
-
Clears a world of all entities, brushes and/or textures.
This is
- useful for when a game level may have finished and you wish to free
- everything up in preparation for loading new entities/brushes/textures
- without having to free every entity/brush/texture individually.
+Clears all entities, brushes and/or textures from the screen and from memory.
+
+As soon as you clear something, you will not be able to use it again until you reload it. Trying to do so will cause a runtime error.
+
+This command is useful for when a level has finished and you wish to load a different level with new entities, brushes and textures.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CollisionNY.htm b/_release/help/commands/3d_commands/CollisionNY.htm
index dfa0c2a..ecd6664 100644
--- a/_release/help/commands/3d_commands/CollisionNY.htm
+++ b/_release/help/commands/3d_commands/CollisionNY.htm
@@ -1,42 +1,34 @@
-Command: CollisionNY
-
-
+Blitz3D Docs
+
-
-
-
CollisionNY# ( entity,index )
-
-
-Parameters:
-
-
-
-
entity - entity handle
- index - index of collision
-
+
CollisionNY# ( entity,index )
+
Parameters
+
+
+
+entity - entity handle
+index - index of collision
+
+
-
Description:
-
-
-
-
Returns the y component of the normal of a particular collision.
Index should
- be in the range 1...CountCollisions(
- entity ) inclusive.
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CollisionNZ.htm b/_release/help/commands/3d_commands/CollisionNZ.htm
index fb13a64..860d479 100644
--- a/_release/help/commands/3d_commands/CollisionNZ.htm
+++ b/_release/help/commands/3d_commands/CollisionNZ.htm
@@ -1,42 +1,34 @@
-Command: CollisionNZ
-
-
+Blitz3D Docs
+
-
-
-
CollisionNX# ( entity,index )
-
-
-Parameters:
-
-
-
-
entity - entity handle
- index - index of collision
-
+
CollisionNZ# ( entity,index )
+
Parameters
+
+
+
+entity - entity handle
+index - index of collision
+
+
-
Description:
-
-
-
-
Returns the z component of the normal of a particular collision.
Index should
- be in the range 1...CountCollisions(
- entity ) inclusive.
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CollisionSurface.htm b/_release/help/commands/3d_commands/CollisionSurface.htm
index 3ccaa13..c974253 100644
--- a/_release/help/commands/3d_commands/CollisionSurface.htm
+++ b/_release/help/commands/3d_commands/CollisionSurface.htm
@@ -1,37 +1,34 @@
-Command: CollisionSurface
-
-
+Blitz3D Docs
+
-
-
-
CollisionSurface
-
-
-Parameters:
-
-
-
-
<param description>
-
+
CollisionSurface ( entity,index )
+
Parameters
+
+
+
+entity - entity handle
+index - index of collision
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CollisionY.htm b/_release/help/commands/3d_commands/CollisionY.htm
index 616669c..ba7e43b 100644
--- a/_release/help/commands/3d_commands/CollisionY.htm
+++ b/_release/help/commands/3d_commands/CollisionY.htm
@@ -1,42 +1,34 @@
-Command: CollisionY
-
-
+Blitz3D Docs
+
-
-
-
CollisionY# ( entity,index )
-
-
-Parameters:
-
-
-
-
entity - entity handle
- index - index of collision
-
+
CollisionY# ( entity,index )
+
Parameters
+
+
+
+entity - entity handle
+index - index of collision
+
+
-
Description:
-
-
-
-
Returns the world y coordinate of a particular collision.
Index should
- be in the range 1...CountCollisions(
- entity ) inclusive.
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CollisionZ.htm b/_release/help/commands/3d_commands/CollisionZ.htm
index bde5b3c..cc98b2d 100644
--- a/_release/help/commands/3d_commands/CollisionZ.htm
+++ b/_release/help/commands/3d_commands/CollisionZ.htm
@@ -1,42 +1,34 @@
-Command: CollisionZ
-
-
+Blitz3D Docs
+
-
-
-
CollisionZ# ( entity,index )
-
-
-Parameters:
-
-
-
-
entity - entity handle
- index - index of collision
-
+
CollisionZ# ( entity,index )
+
Parameters
+
+
+
+entity - entity handle
+index - index of collision
+
+
-
Description:
-
-
-
-
Returns the world z coordinate of a particular collision.
Index should
- be in the range 1...CountCollisions(
- entity ) inclusive.
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/Collisions.htm b/_release/help/commands/3d_commands/Collisions.htm
index 8daf155..22d6868 100644
--- a/_release/help/commands/3d_commands/Collisions.htm
+++ b/_release/help/commands/3d_commands/Collisions.htm
@@ -1,191 +1,191 @@
-Command: Collisions
-
-
+Blitz3D Docs
+
-
-
-
Collisions
-src_type,dest_type,method,response
-
-
-Parameters:
-
-
-
-
src_type - entity type to be checked for collisions.
- dest_type - entity type to be collided with.
-
- method - collision detection method.
- 1: sphere-to-sphere collisions
- 2: sphere-to-polygon collisions
- 3: sphere-to-box collisions
-
- response - what the source entity does when a collision occurs.
- 1: stop
- 2: slide1 - full sliding collision
- 3: slide2 - prevent entities from sliding down slopes
-
+
Collisions src_type,dest_type,method,response
+
Parameters
+
+
+
+src_type - entity type to be checked for collisions.
+dest_type - entity type to be collided with.
+
+method - collision detection method.
+1: ellipsoid-to-ellipsoid collisions
+2: ellipsoid-to-polygon collisions
+3: ellipsoid-to-box collisions
+
+response - what the source entity does when a collision occurs.
+1: stop
+2: slide1 - full sliding collision
+3: slide2 - prevent entities from sliding down slopes
+
+
-
Description:
-
-
-
-
Enables collisions between two different entity types.
Entity types
- are just numbers you assign to an entity using
- EntityType. Blitz uses then uses the entity types to check for
- collisions between all the entities that have those entity types.
-
Blitz has many ways of checking for collisions, as denoted by the method
- parameter. However, collision checking is always sphere to something. In
- order for Blitz to know what size a source entity is, you must first assign
- an entity radius to all source entities using
- EntityRadius.
-
In the case of a collision detection method of 1 being selected
- (sphere-to-sphere), then the destination entities concerned will need to
- have an EntityRadius assigned to them too. In
- the case of method being 2 being selected (sphere-to-box), then the
- destination entities will need to have an EntityBox
- assigned to them. Method No.2 (sphere-to-polygon) requires nothing to be
- assigned to the destination entities.
-
Not only does Blitz check for collisions, but it acts upon them when it
- detects them too, as denoted by the response parameter. You have three
- options in this situation. You can either choose to make the source entity
- stop, slide or only slide upwards.
-
All collision checking occurs, and collision responses are acted out,
- when UpdateWorld is called.
-
- Finally, every time the Collision command is used, collision information is
- added to the collision information list. This can be cleared at any time
- using the ClearCollisions command.
-
+
Description
+
+
+
+Enables collisions between two different entity types.
+
+Entity types are just numbers you assign to an entity using EntityType. Blitz then uses the entity types to check for collisions between all the entities that have those entity types.
+
+Blitz has many ways of checking for collisions, as denoted by the method parameter. However, collision checking is always ellipsoid to something. In order for Blitz to know what size a source entity is, you must first assign an entity radius to all source entities using EntityRadius.
+
+In the case of collision detection method 1 being selected (ellipsoid-to-ellipsoid), then the destination entities concerned will need to have an EntityRadius assigned to them too. In the case of method 3 being selected (ellipsoid-to-box), then the destination entities will need to have an EntityBox assigned to them. Method 2 (ellipsoid-to-polygon) requires nothing to be assigned to the destination entities.
+
+Not only does Blitz check for collisions, but it acts upon them when it detects them too, as denoted by the response parameter. You have three options in this situation. You can either choose to make the source entity stop, slide or only slide upwards.
+
+All collision checking occurs, and collision responses are acted out, when UpdateWorld is called.
+
+Finally, every time the Collision command is used, collision information is added to the collision information list. This can be cleared at any time using the ClearCollisions command.
+
+
+See also: EntityBox, EntityRadius, Collisions, EntityType, ResetEntity.
+
+entity - Entity Handle
+parent (optional) - Entity that will act as Parent to the copy.
+
+
-
Description:
-
-
-
-
Creates a copy of an entity and returns the copied entity's handle.
If
- a parent entity is specified, then the copied entity will be created at the
- parent entity's position. Otherwise, it will be created at 0,0,0.
-
+
Description
+
+
+
+Creates a copy of an entity and returns the handle of the newly created copy. This is a new entity instance of an existing entity's mesh! Anything you do to the original Mesh (such as RotateMesh) will effect all the copies. Other properties (such as EntityColor, Position etc.) since they are 'Entity' properties, will be individual to the copy.
+
+If a parent entity is specified, the copied entity will be created at the parent entity's position. Otherwise, it will be created at 0,0,0.
+
+; CopyEntity Example
+; This example creates an entity and
+; allows you to make copies of it.
+
+Graphics3D 640,480
+AppTitle "CopyEntity Example"
+
+Cam = CreateCamera()
+Lit = CreateLight()
+
+PositionEntity Lit,-5,-5,0
+PositionEntity Cam,0,0,-5
+
+AnEntity = CreateCube() ; This is our Test Entity
+ScaleMesh anEntity,0.4,0.4,0.4
+While Not KeyDown(1) ; Until we press ESC
+
+If KeyHit(57) Then
+
+; When we hit Space, a new Entity is created
+; These share the same internal mesh structure though!
+; Hence although we are only Rotating the original MESH
+; Linked to the original Entity, since it is a Mesh command,
+; all the Entity Copies are linked to it..
+
+NewEntity = CopyEntity(AnEntity) ; Hit Space to Copy!
+
+; Change the Color of the Entity. Since this is an entity
+; Property, it doesn't effect the other copies.
+EntityColor NewEntity,Rand(255),Rand(255),Rand(255)
+PositionEntity NewEntity,Rand(4)-2,Rand(4)-2,0
+EndIf
+
+SeedRnd MilliSecs()
+
+RotateMesh AnEntity,.25,.35,.45
+
+RenderWorld ; Draw the Scene
+Flip ; Flip it into View
+Wend
+
+End
+
+Returns the number of surfaces in a mesh.
+
+Surfaces are sections of mesh. A mesh may contain only one section, or very many.
+
+See also: GetSurface.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CountVertices.htm b/_release/help/commands/3d_commands/CountVertices.htm
index d08c4b4..1081a59 100644
--- a/_release/help/commands/3d_commands/CountVertices.htm
+++ b/_release/help/commands/3d_commands/CountVertices.htm
@@ -1,37 +1,28 @@
-Command: CountVertices
-
-
+Blitz3D Docs
+
-
-
-
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateBrush.htm b/_release/help/commands/3d_commands/CreateBrush.htm
index 86b2606..5946b2a 100644
--- a/_release/help/commands/3d_commands/CreateBrush.htm
+++ b/_release/help/commands/3d_commands/CreateBrush.htm
@@ -1,101 +1,95 @@
-Command: CreateBrush
-
-
+Blitz3D Docs
+
-
-
-
CreateBrush ( [red#][,green#][,blue#] )
-
-
-Parameters:
-
-
-
-
red# (optional) - brush red value
- green# (optional) - brush green value
- blue# (optional) - brush blue value
-
+
CreateBrush ( [red#][,green#][,blue#] )
+
Parameters
+
+
+
+red# (optional) - brush red value
+green# (optional) - brush green value
+blue# (optional) - brush blue value
+
+
-
Description:
-
-
-
-
Creates a brush and returns a brush handle.
The optional green, red and blue values
- allow you to set the colour of the brush. Values should be in the range
- 0-255. If omitted the values default to 255.
-
- A brush is a collection of properties such as Colour, Alpha, Shininess,
- Texture etc that are all stored as part of the brush. Then, all these properties can
- be applied to an entity, mesh or surface at once just by using
- PaintEntity, PaintMesh
- or PaintSurface.
-
When creating your own
- mesh, if you wish for certain surfaces to look differently from one
- another, then you will need to use brushes to paint individual surfaces. Using commands such as EntityColor, EntityAlpha will apply the effect to all
- surfaces at once, which may not be what you wish to achieve.
+Creates a brush and returns a brush handle.
+
+The optional green, red and blue values allow you to set the colour of the brush. Values should be in the range 0-255. If omitted the values default to 255.
+
+A brush is a collection of properties such as Colour, Alpha, Shininess, Texture etc that are all stored as part of the brush. Then, all these properties can be applied to an entity, mesh or surface at once just by using PaintEntity, PaintMesh or PaintSurface.
+
+When creating your own mesh, if you wish for certain surfaces to look differently from one another, then you will need to use brushes to paint individual surfaces. Using commands such as EntityColor, EntityAlpha will apply the effect to all surfaces at once, which may not be what you wish to achieve.
+
+See also: LoadBrush.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CreateCamera.htm b/_release/help/commands/3d_commands/CreateCamera.htm
index 5f9fab3..00f2ae4 100644
--- a/_release/help/commands/3d_commands/CreateCamera.htm
+++ b/_release/help/commands/3d_commands/CreateCamera.htm
@@ -1,67 +1,63 @@
-Command: CreateCamera
-
-
+Blitz3D Docs
+
-
-
-
CreateCamera ( [parent] )
-
-
-Parameters:
-
-
-
-
parent (optional) - parent entity of camera
-
+
CreateCamera ( [parent] )
+
Parameters
+
+
+
+parent (optional) - parent entity of camera
+
+
-
Description:
-
-
-
-
Creates a camera entity and returns its handle.
Without
- at least one camera, you won't be able to see anything in your 3D world. With more than one camera, you will be to achieve effect such as
- split-screen modes and rear-view mirrors.
-
A camera can only render to the backbuffer. If you wish to display 3D
- graphics on an image or a texture then copy the contents of the backbuffer
- to the appropriate buffer.
-
The optional parent parameter allow you to specify a parent entity for
- the camera so that when the parent is moved the child camera will move with
- it. However, this relationship is one way; applying movement commands to the
- child will not affect the parent.
-
Specifying a parent entity will still result in the camera being created
- at position 0,0,0 rather than at the parent entity's position.
-
+
Description
+
+
+
+Creates a camera entity and returns its handle.
+
+Without at least one camera, you won't be able to see anything in your 3D world. With more than one camera, you will be to achieve effect such as split-screen modes and rear-view mirrors.
+
+A camera can only render to the backbuffer. If you wish to display 3D graphics on an image or a texture then copy the contents of the backbuffer to the appropriate buffer.
+
+The optional parent parameter allow you to specify a parent entity for the camera so that when the parent is moved the child camera will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the camera being created at position 0,0,0 rather than at the parent entity's position.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateCone.htm b/_release/help/commands/3d_commands/CreateCone.htm
index f44859c..637e33d 100644
--- a/_release/help/commands/3d_commands/CreateCone.htm
+++ b/_release/help/commands/3d_commands/CreateCone.htm
@@ -1,84 +1,75 @@
-Command: CreateCone
-
-
+Blitz3D Docs
+
-
-
-
CreateCone ( [segments][,parent][,solid] )
-
-
-Parameters:
-
-
-
-
segments (optional) - cone detail. Defaults to 8.
- parent (optional) - parent entity of cone
- solid (optional) - true for a cone with a
- base, false for a cone without a base. Defaults to true.
-
+
CreateCone ( [segments][,solid][,parent] )
+
Parameters
+
+
+
+segments (optional) - cone detail. Defaults to 8.
+solid (optional) - true for a cone with a base, false for a cone without a base. Defaults to true.
+parent (optional) - parent entity of cone
+
+
-
Description:
-
-
-
-
Creates a cone mesh/entity and returns its handle.
The cone will be centred
- at 0,0,0 and the base of the cone will have a radius of 1.
-
The segments value must be in the range 3-100 inclusive, although this is
- only checked in debug mode. A common mistake
- is to leave debug mode off and specify the parent parameter
- (usually an eight digit memory address) in the place of the segments value.
- As the amount of polygons used to create a cone is exponentially
- proportional to the segments value, this will result in Blitz trying to create a
- cone
- with unimaginable amounts of polygons! Depending on how unlucky you are,
- your computer will then crash.
Example segments values (solid=true):
- 4: 6 polygons - a pyramid
- 8: 14 polygons - bare minimum amount of polygons for a cone
- 16: 30 polygons - smooth cone at medium-high distances
- 32: 62 polygons - smooth cone at close distances
The
- optional parent parameter allow you to specify a parent entity for the cone
- so that when the parent is moved the child cone will move with it. However,
- this relationship is one way; applying movement commands to the child will
- not affect the parent.
-
Specifying a parent entity will still result in the cone being created at
- position 0,0,0 rather than at the parent entity's position.
+Creates a cone mesh/entity and returns its handle.
+
+The cone will be centred at 0,0,0 and the base of the cone will have a radius of 1.
+
+The segments value must be in the range 3-100 inclusive, although this is only checked in debug mode. A common mistake is to leave debug mode off and specify the parent parameter (usually an eight digit memory address) in the place of the segments value. As the amount of polygons used to create a cone is exponentially proportional to the segments value, this will result in Blitz trying to create a cone with unimaginable amounts of polygons! Depending on how unlucky you are, your computer will then crash.
+
+Example segments values (solid=true):
+4: 6 polygons - a pyramid
+8: 14 polygons - bare minimum amount of polygons for a cone
+16: 30 polygons - smooth cone at medium-high distances
+32: 62 polygons - smooth cone at close distances
+
+The optional parent parameter allow you to specify a parent entity for the cone so that when the parent is moved the child cone will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the cone being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: CreateCube, CreateSphere, CreateCylinder.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateCube.htm b/_release/help/commands/3d_commands/CreateCube.htm
index 2705ecb..a04d52d 100644
--- a/_release/help/commands/3d_commands/CreateCube.htm
+++ b/_release/help/commands/3d_commands/CreateCube.htm
@@ -1,69 +1,67 @@
-Command: CreateCube
-
-
+Blitz3D Docs
+
-
-
-
CreateCube( [parent] )
-
-
-Parameters:
-
-
-
-
parent (optional) - parent entity of cube
-
+
CreateCube( [parent] )
+
Parameters
+
+
+
+[parent] (optional) - This allows you to set the parent entity of Cube.
+
+
-
Description:
-
-
-
-
Creates a cube mesh/entity and returns its handle.
The cube will extend from
- -1,-1,-1 to +1,+1,+1.
-
-
The optional parent parameter allow you to specify a parent entity for
- the cube so that when the parent is moved the child cube will move with it.
- However, this relationship is one way; applying movement commands to the
- child will not affect the parent.
-
Specifying a parent entity will still result in the cube being created at
- position 0,0,0 rather than at the parent entity's position.
+Creates a cube mesh/entity and returns its handle.
+
+The cube will extend from -1,-1,-1 to +1,+1,+1.
+
+The optional parent parameter allow you to specify a parent entity for the cube so that when the parent is moved the child cube will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the cube being created at position 0,0,0 rather than at the parent entity's position.
+
+Creation of cubes, cylinders and cones are a great way of getting scenes set up quickly, as they can act as placeholders for more complex pre-modeled meshes later on in program development.
+
+See also: CreateSphere(), CreateCylinder(), CreateCone().
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateCylinder.htm b/_release/help/commands/3d_commands/CreateCylinder.htm
index ba8dd57..9de7b50 100644
--- a/_release/help/commands/3d_commands/CreateCylinder.htm
+++ b/_release/help/commands/3d_commands/CreateCylinder.htm
@@ -1,84 +1,75 @@
-Command: CreateCylinder
-
-
+Blitz3D Docs
+
-
-
-
CreateCylinder ( [segments][,parent][,solid] )
-
-
-Parameters:
-
-
-
-
segments (optional) - cylinder detail. Defaults to 8.
- parent (optional) - parent entity of cylinder
- solid (optional) - true for a cylinder, false for a tube. Defaults to true.
-
+
CreateCylinder ( [segments][,solid][,parent] )
+
Parameters
+
+
+
+segments (optional) - cylinder detail. Defaults to 8.
+solid (optional) - true for a cylinder, false for a tube. Defaults to true.
+parent (optional) - parent entity of cylinder
+
+
-
Description:
-
-
-
-
Creates a cylinder mesh/entity and returns its handle.
The cylinder
- will be centred
- at 0,0,0 and will have a radius of 1.
-
The segments value must be in the range 3-100 inclusive, although this is
- only checked in debug mode. A common mistake
- is to leave debug mode off and specify the parent parameter
- (usually an eight digit memory address) in the place of the segments value.
- As the amount of polygons used to create a cylinder is exponentially
- proportional to the segments value, this will result in Blitz trying to create a
- cylinder
- with unimaginable amounts of polygons! Depending on how unlucky you are,
- your computer may then crash.
Example segments values (solid=true):
- 3: 8 polygons - a prism
- 8: 28 polygons - bare minimum amount of polygons for a cylinder
- 16: 60 polygons - smooth cylinder at medium-high distances
- 32: 124 polygons - smooth cylinder at close distances
The
- optional parent parameter allow you to specify a parent entity for the
- cylinder so that when the parent is moved the child cylinder will move with
- it. However, this relationship is one way; applying movement commands to the
- child will not affect the parent.
-
Specifying a parent entity will still result in the cylinder being
- created at position 0,0,0 rather than at the parent entity's position.
+Creates a cylinder mesh/entity and returns its handle.
+
+The cylinder will be centred at 0,0,0 and will have a radius of 1.
+
+The segments value must be in the range 3-100 inclusive, although this is only checked in debug mode. A common mistake is to leave debug mode off and specify the parent parameter (usually an eight digit memory address) in the place of the segments value. As the amount of polygons used to create a cylinder is exponentially proportional to the segments value, this will result in Blitz trying to create a cylinder with unimaginable amounts of polygons! Depending on how unlucky you are, your computer may then crash.
+
+Example segments values (solid=true):
+3: 8 polygons - a prism
+8: 28 polygons - bare minimum amount of polygons for a cylinder
+16: 60 polygons - smooth cylinder at medium-high distances
+32: 124 polygons - smooth cylinder at close distances
+
+The optional parent parameter allow you to specify a parent entity for the cylinder so that when the parent is moved the child cylinder will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the cylinder being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: CreateCube, CreateSphere, CreateCone.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateLight.htm b/_release/help/commands/3d_commands/CreateLight.htm
index 99ef661..dff39dd 100644
--- a/_release/help/commands/3d_commands/CreateLight.htm
+++ b/_release/help/commands/3d_commands/CreateLight.htm
@@ -1,65 +1,82 @@
-Command: CreateLight
-
-
+Blitz3D Docs
+
-
-
-
CreateLight ( [type][,parent] )
-
-
-Parameters:
-
-
-
-
type (optional) - type of light
- 1: directional
- 2: point
- 3: spot
-
- parent (optional) - parent entity of light
-
+
CreateLight ( [type][,parent] )
+
Parameters
+
+
+
+type (optional) - type of light
+1: directional (default)
+2: point
+3: spot
+
+parent (optional) - parent entity of light
+
+
-
Description:
-
-
-
-
Creates a light.
Lights work by affecting the colour of all vertices
- within the light's range. You need at to create at least one light if you
- wish to use 3D graphics otherwise everything will appear flat.
-
- The optional type parameter allows you to specify the type of light you wish
- to create. A value of 1 creates a directional light. This works similar to a
- sun shining on a house. All walls facing a certain direction are lit the
- same. How much they are lit by depends on the angle of the light reaching
- them.
-
- A value of 2 creates a point light. This works a little bit like a light
- bulb in a house, starting from a central point and gradually fading
- outwards.
-
- A value of 3 creates a spot light. This is a cone of light. This works
- similar to shining a torch in a house. It starts with an inner angle of
- light, and then extends towards an outer angle of light.
-
-
The optional parent parameter allow you to specify a parent entity for
- the light so that when the parent is moved the child light will move with
- it. However, this relationship is one way; applying movement commands to the
- child will not affect the parent.
-
Specifying a parent entity will still result in the light being created
- at position 0,0,0 rather than at the parent entity's position.
-
+
Description
+
+
+
+Creates a light.
+
+Lights work by affecting the colour of all vertices within the light's range. You need at to create at least one light if you wish to use 3D graphics otherwise everything will appear flat.
+
+The optional type parameter allows you to specify the type of light you wish to create. A value of 1 creates a directional light. This works similar to a sun shining on a house. All walls facing a certain direction are lit the same. How much they are lit by depends on the angle of the light reaching them. Directional lights have infinite 'position' and infinite range.
+
+A value of 2 creates a point (or omni) light. This works a little bit like a light bulb in a house, starting from a central point and gradually fading outwards.
+
+A value of 3 creates a spot light. This is a cone of light. This works similar to shining a torch in a house. It starts with an inner angle of light, and then extends towards an outer angle of light. You can adjust the angles of a 'spot' light with the LightConeAngles command.
+
+The optional parent parameter allow you to specify a parent entity for the light so that when the parent is moved the child light will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the light being created at position 0,0,0 rather than at the parent entity's position.
+
+
+Other notes:
+There is a DirectX limit on the number of lights available per scene - this is either 8 or 16 depending on your video card, but you should always assume 8.
+
+Also, you should remember that each light added effects the rendering speed.
+
+Lights do not cast shadows, like they do in real life.
+
+Most games get around these issues by the use of a pre-calculated 'baked' lightmap texture for the static geometry in the scene.
+
+Other lighting techniques include: adjusting vertex colors, dynamic shadows, and/or dynamic lights (ie. moving the lights around in the scene as they are needed).
+
+
+See also: LightRange, LightColor, LightConeAngles, AmbientLight.
+
+Graphics3D 640,480
+
+camera = CreateCamera()
+MoveEntity camera,0,0,-3
+
+ball = CreateSphere()
+
+lite = CreateLight(1) ; change this to 2 or 3 to see different lights
+MoveEntity lite,5,0,0
+PointEntity lite,ball ; make sure light is pointing at ball
+
+While Not KeyDown(1)
+RenderWorld:Flip
+Wend
+End
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateListener.htm b/_release/help/commands/3d_commands/CreateListener.htm
index 122bac8..17a791e 100644
--- a/_release/help/commands/3d_commands/CreateListener.htm
+++ b/_release/help/commands/3d_commands/CreateListener.htm
@@ -1,45 +1,82 @@
-Command: CreateListener
-
-
+Blitz3D Docs
+
-
-
-
parent - parent entity of listener. A parent entity, typically a camera,
- must be specified to 'carry' the listener around.
- rolloff_factor# (optional) - the rate at which volume diminishes with
- distance. Defaults to 1.
- doppler_scale# (optional) - the severity of the doppler effect. Defaults to
- 1.
- distance_scale# (optional) - artificially scales distances. Defaults to 1.
+parent - parent entity of listener. A parent entity, typically a camera, must be specified to 'carry' the listener around.
+rolloff_factor# (optional) - the rate at which volume diminishes with distance. Defaults to 1.
+doppler_scale# (optional) - the severity of the doppler effect. Defaults to 1.
+distance_scale# (optional) - artificially scales distances. Defaults to 1.
+
+
-
Description:
-
-
-
-
Creates a listener entity and returns its handle. Currently, only a
- single listener is supported.
-
+
Description
+
+
+
+Creates a listener entity and returns its handle. Currently, only a single listener is supported.
+
+; CreateListener Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+cube_tex=LoadTexture("media/b3dlogo.jpg")
+EntityTexture cube,cube_tex
+PositionEntity cube,0,1,0
+
+microphone=CreateListener(camera) ; Create listener, make it child of camera
+sound=Load3DSound("media/ufo.wav") ; Load 3D sound
+
+While Not KeyDown(1)
+
+If KeyDown(205)=True Then TurnEntity camera,0,-1,0
+If KeyDown(203)=True Then TurnEntity camera,0,1,0
+If KeyDown(208)=True Then MoveEntity camera,0,0,-0.05
+If KeyDown(200)=True Then MoveEntity camera,0,0,0.05
+
+; If left mouse button hit then emit sound from cube
+If MouseHit(1) = True Then EmitSound(sound,cube)
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to make a sound be emitted from the cube"
+
+Flip
+
+Wend
+
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CreateMesh.htm b/_release/help/commands/3d_commands/CreateMesh.htm
index af361eb..2280ecc 100644
--- a/_release/help/commands/3d_commands/CreateMesh.htm
+++ b/_release/help/commands/3d_commands/CreateMesh.htm
@@ -1,37 +1,116 @@
-Command: CreateMesh
-
-
+Blitz3D Docs
+
-
-
-
CreateMesh ( [parent] )
-
-
-Parameters:
-
-
-
-
parent (optional) - parent entity of mesh
-
+
CreateMesh([parent])
+
Parameters
+
+
+
+parent (optional) - This optional parameter allows you to specify another entity which will act as the parent to this mesh.
+
+
-
Description:
-
-
-
-
Creates a mesh and returns a mesh handle.
-
+
Description
+
+
+
+Create a 'blank' mesh entity and returns its handle.
+
+When a mesh is first created it has no surfaces, vertices or triangles associated with it.
+
+To add geometry to this mesh, you will need to:
+
+CreateSurface() ; To make a surface
+AddVertex ; You will need to add at least 3 to make a Triangle
+AddTriangle ; This will add a triangle by connecting the Vertices (points) you added to the mesh.
+
+; CreateMesh Example
+; ------------------
+
+; In this example, we will create a custom mesh. This custom mesh will be in the shape of a ramp.
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,45,0,0
+
+; Create blank mesh
+ramp=CreateMesh()
+
+; Create blank surface which is attached to mesh (surfaces must always be attached to a mesh)
+surf=CreateSurface(ramp)
+
+; Now we have our blank mesh and surface, we can start adding vertices to it, to form the shape of our
+; ramp.
+; Vertices are invisible 'points' in a 3D object that we can attach triangles too later.
+; To create a single triangle, you need three vertices, one for each corner.
+; However, you can share vertices between triangles, so you do not always need 3 new vertices per
+; triangle.
+; In the case of our ramp mesh, we will require 6 vertices, one for each corner
+
+v0=AddVertex(surf,0,0,0) ; bottom corner 1
+v1=AddVertex(surf,0,0,1) ; bottom corner 2
+v2=AddVertex(surf,4,0,1) ; bottom corner 3
+v3=AddVertex(surf,4,0,0) ; bottom corner 4
+v4=AddVertex(surf,0,2,0) ; top corner 1
+v5=AddVertex(surf,0,2,1) ; top corner 2
+
+; Having created our blank mesh and surface, and added our vertices to form the shape of the mesh, we
+; now need to add triangles to it in order to make it solid and visible to the user. We create
+; triangles simply by connecting vertices up, very much like a 3D dot-to-dot.
+
+; When adding triangles, we need to remember that they are only one sided, and the side they are
+; visible from is determined by the order in which we specify the vertices when using AddTriangle.
+; If the vertices, in the order that they are specified, are aligned in a clockwise fashion relative
+; to the camera then they will appear visible, otherwise they won't.
+; So, to make our ramp visible from the outside, we will be connecting all vertices in a clockwise
+; fashion, relative to the camera.
+
+t0=AddTriangle(surf,v0,v3,v2) ; bottom triangle 1
+t1=AddTriangle(surf,v0,v2,v1) ; bottom triangle 2
+t2=AddTriangle(surf,v0,v4,v3) ; front triangle
+t3=AddTriangle(surf,v1,v2,v5) ; back triangle
+t4=AddTriangle(surf,v0,v1,v5) ; side triangle 1
+t5=AddTriangle(surf,v0,v5,v4) ; side triangle 2
+t6=AddTriangle(surf,v2,v4,v5) ; top triangle 1
+t7=AddTriangle(surf,v2,v3,v4) ; top triangle 2
+
+; Now we will position our ramp in front of the camera so we can see it!
+PositionEntity ramp,0,-4,10
+
+; Enable wireframe mode so we can see structure of model more clearly
+WireFrame True
+
+; And a quick loop that renders the scene and displays the contents on the screen until we press esc
+While Not KeyDown(1)
+
+; Constantly turn our ramp entity to show it off a bit
+TurnEntity ramp,0,1,0
+
+RenderWorld
+Flip
+
+Wend
+
+; The end!
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CreateMirror.htm b/_release/help/commands/3d_commands/CreateMirror.htm
index 8dc26ba..f9a2301 100644
--- a/_release/help/commands/3d_commands/CreateMirror.htm
+++ b/_release/help/commands/3d_commands/CreateMirror.htm
@@ -1,91 +1,86 @@
-Command: CreateMirror
-
-
+Blitz3D Docs
+
-
-
-
CreateMirror ( [parent] )
-
-
-Parameters:
-
-
-
-
parent - parent entity of mirror
-
+
CreateMirror ( [parent] )
+
Parameters
+
+
+
+parent - parent entity of mirror
+
+
-
Description:
-
-
-
-
Creates a mirror entity and returns its handle.
A mirror entity is
- basically a flat, infinite 'ground'. This ground is invisible, except it
- reflects anything above it, below it. It is useful for games where you want
- have the effect of a shiny floor showing a reflection. For a true shiny
- floor efffect, try combining a mirror entity with a textured plane entity
- that has an alpha level of 0.5.
-
The optional parent parameter allow you to specify a parent entity for
- the mirror so that when the parent is moved the child mirror will move
- with it. However, this relationship is one way; applying movement commands
- to the child will not affect the parent.
-
Specifying a parent entity will still result in the mirror being created
- at position 0,0,0 rather than at the parent entity's position.
+Creates a mirror entity and returns its handle.
+
+A mirror entity is basically a flat, infinite 'ground'. This ground is invisible, except it vertically flips anything above it, below it and vice versa. It is useful for games where you want have the effect of a shiny floor showing a reflection. For a true shiny floor effect, try combining a mirror entity with a textured plane entity that has an alpha level of 0.5.
+
+The optional parent parameter allows you to specify a parent entity for the mirror so that when the parent is moved the child mirror will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the mirror being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: CreatePlane.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreatePivot.htm b/_release/help/commands/3d_commands/CreatePivot.htm
index 62acbd4..9d51461 100644
--- a/_release/help/commands/3d_commands/CreatePivot.htm
+++ b/_release/help/commands/3d_commands/CreatePivot.htm
@@ -1,47 +1,73 @@
-Command: CreatePivot
-
-
+Blitz3D Docs
+
-
-
-
CreatePivot ( [parent] )
-
-
-Parameters:
-
-
-
-
parent (optional) - parent entity of pivot
-
+
CreatePivot ( [parent] )
+
Parameters
+
+
+
+parent (optional) - parent entity of pivot
+
+
-
Description:
-
-
-
-
Creates a pivot entity.
A pivot entity is an invisible
- point in 3D space that's main use is to act as a parent entity to other
- entities. The pivot can then be used to control lots of entities at once, or
- act as new centre of rotation for other entities.
-
To enforce this relationship; use EntityParent
- or make use of the optional parent entity parameter available with all
- entity load/creation commands.
-
Indeed, this parameter is also available with the CreatePivot command if
- you wish for the pivot to have a parent entity itself.
-
-
-
+
Description
+
+
+
+Creates a pivot entity.
+
+A pivot entity is an invisible point in 3D space that's main use is to act as a parent entity to other entities. The pivot can then be used to control lots of entities at once, or act as new centre of rotation for other entities.
+
+To enforce this relationship; use EntityParent or make use of the optional parent entity parameter available with all entity load/creation commands.
+
+Indeed, this parameter is also available with the CreatePivot command if you wish for the pivot to have a parent entity itself.
+
+; CreatePivot Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,0,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create pivot. This is invisible.
+pivot=CreatePivot()
+
+; Create planet (i.e. a sphere). Make the pivot the parent of the planet.
+planet=CreateSphere(16,pivot)
+
+; Position planet so that it is offset from the pivot
+PositionEntity planet,5,0,0
+
+While Not KeyDown(1)
+
+; Turn pivot, thus making planet spin around it
+TurnEntity pivot,0,1,0
+
+RenderWorld
+Flip
+
+Wend
+
+End
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreatePlane.htm b/_release/help/commands/3d_commands/CreatePlane.htm
index 649c1c3..74af367 100644
--- a/_release/help/commands/3d_commands/CreatePlane.htm
+++ b/_release/help/commands/3d_commands/CreatePlane.htm
@@ -1,85 +1,81 @@
-Command: CreatePlane
-
-
+Blitz3D Docs
+
-
-
-
CreatePlane ( [sub_divs][,parent] )
-
-
-Parameters:
-
-
-
-
sub_divs - sub divisions of plane
- parent (optional) - parent entity of plane
-
+
CreatePlane ( [sub_divs][,parent] )
+
Parameters
+
+
+
+sub_divs (optional) - sub divisions of plane. Should be in the range 1-16. The default value is 1.
+parent (optional) - parent entity of plane
+
+
-
Description:
-
-
-
-
Creates a plane entity and returns its handle.
A plane entity is
- basically a flat, infinite 'ground'. It is useful for outdoor games where
- you never want the player to see/reach the edge of the game world.
-
The optional sub_divs parameter specified how sub divisions of polygons
- the plane will have. Although a plane is flat and so adding extra polygons
- will not make it smoother, adding more polygons will allow more vertices to
- be lit for more detailed lighting effects.
-
The optional parent parameter allow you to specify a parent entity for
- the plane so that when the parent is moved the child plane will move
- with it. However, this relationship is one way; applying movement commands
- to the child will not affect the parent.
-
Specifying a parent entity will still result in the plane being created
- at position 0,0,0 rather than at the parent entity's position.
+Creates a plane entity and returns its handle.
+
+A plane entity is basically a flat, infinite 'ground'. It is useful for outdoor games where you never want the player to see/reach the edge of the game world.
+
+The optional sub_divs parameter determines how many sub divisions of polygons the plane will have. Although a plane is flat and so adding extra polygons will not make it smoother, adding more polygons will allow more vertices to be lit for more detailed lighting effects.
+
+The optional parent parameter allows you to specify a parent entity for the plane so that when the parent is moved the child plane will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the plane being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: CreateMirror.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateSphere.htm b/_release/help/commands/3d_commands/CreateSphere.htm
index d5309e4..ecc2ed3 100644
--- a/_release/help/commands/3d_commands/CreateSphere.htm
+++ b/_release/help/commands/3d_commands/CreateSphere.htm
@@ -1,81 +1,73 @@
-Command: CreateSphere
-
-
+Blitz3D Docs
+
-
-
-
CreateSphere ( [segments][,parent] )
-
-
-Parameters:
-
-
-
-
segments (optional) - sphere detail. Defaults to 8.
- parent (optional) - parent entity of sphere
-
+
CreateSphere ( [segments][,parent] )
+
Parameters
+
+
+
+segments (optional) - sphere detail. Defaults to 8.
+parent (optional) - parent entity of sphere
+
+
-
Description:
-
-
-
-
Creates a sphere mesh/entity and returns its handle.
The sphere will
- be centred
- at 0,0,0 and will have a radius of 1.
-
The segments value must be in the range 2-100 inclusive, although this is
- only checked in debug mode. A common mistake
- is to leave debug mode off and specify the parent parameter
- (usually an eight digit memory address) in the place of the segments value.
- As the amount of polygons used to create a sphere is exponentially
- proportional to the segments value, this will result in Blitz trying to create a sphere
- with unimaginable amounts of polygons! Depending on how unlucky you are,
- your computer will then crash.
Example segments values:
- 8: 224 polygons - bare minimum amount of polygons for a sphere
- 16: 960 polygons - smooth looking sphere at medium-high distances
- 32: 3968 polygons - smooth sphere at close distances
The
- optional parent parameter allow you to specify a parent entity for the
- sphere so that when the parent is moved the child sphere will move with it.
- However, this relationship is one way; applying movement commands to the
- child will not affect the parent.
-
Specifying a parent entity will still result in the sphere being created
- at position 0,0,0 rather than at the parent entity's position.
+Creates a sphere mesh/entity and returns its handle.
+
+The sphere will be centred at 0,0,0 and will have a radius of 1.
+
+The segments value must be in the range 2-100 inclusive, although this is only checked in debug mode. A common mistake is to leave debug mode off and specify the parent parameter (usually an eight digit memory address) in the place of the segments value. As the amount of polygons used to create a sphere is exponentially proportional to the segments value, this will result in Blitz trying to create a sphere with unimaginable amounts of polygons! Depending on how unlucky you are, your computer will then crash.
+
+Example segments values:
+8: 224 polygons - bare minimum amount of polygons for a sphere
+16: 960 polygons - smooth looking sphere at medium-high distances
+32: 3968 polygons - smooth sphere at close distances
+
+The optional parent parameter allow you to specify a parent entity for the sphere so that when the parent is moved the child sphere will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the sphere being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: CreateCube, CreateCylinder, CreateCone.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateSprite.htm b/_release/help/commands/3d_commands/CreateSprite.htm
index d123fb5..1227d41 100644
--- a/_release/help/commands/3d_commands/CreateSprite.htm
+++ b/_release/help/commands/3d_commands/CreateSprite.htm
@@ -1,59 +1,61 @@
-Command: CreateSprite
-
-
+Blitz3D Docs
+
-
-
-
CreateSprite ( [parent] )
-
-
-Parameters:
-
-
-
-
parent (optional) - parent entity of sprite
-
+
CreateSprite ( [parent] )
+
Parameters
+
+
+
+parent (optional) - parent entity of sprite
+
+
-
Description:
-
-
-
-
Creates a sprite entity and returns its handle.
The sprite will be
- positioned at 0,0,0 and extend from 1,-1 to +1,+1.
-
A sprite entity is a flat, square (which can be made rectangular by
- scaling it) 3D object.
-
Sprites have two real strengths. The first is that they consist of only
- two polygons; meaning you can use many of them at once. This makes them
- ideal for particle effects and 2D-using-3D games where you want lots of
- sprites on-screen at once.
-
Secondly, sprites can be assigned a view mode using
- SpriteViewMode. By default this view mode
- is set to 1, which means the sprite will always face the camera. So no
- matter what the orientation of the camera is relative to the sprite, you
- will never actually notice that they are flat; by giving them a spherical
- texture, you can make them appear to look no different than a normal sphere.
-
-
The optional parent parameter allow you to specify a parent entity for
- the sprite so that when the parent is moved the child sprite will move with
- it. However, this relationship is one way; applying movement commands to the
- child will not affect the parent.
-
Specifying a parent entity will still result in the sprite being created
- at position 0,0,0 rather than at the parent entity's position.
+Creates a sprite entity and returns its handle. Sprites are simple flat (usually textured) rectangles made from two triangles. Unlike other entity objects they don't actually have a mesh that can be manipulated.
+
+The sprite will be positioned at 0,0,0 and extend from 1,-1 to +1,+1.
+
+Sprites have two real strengths. The first is that they consist of only two polygons; meaning you can use many of them at once. This makes them ideal for particle effects and 2D-using-3D games where you want lots of sprites on-screen at once.
+
+Secondly, sprites can be assigned a view mode using SpriteViewMode. By default this view mode is set to 1, which means the sprite will always face the camera. So no matter what the orientation of the camera is relative to the sprite, you will never actually notice that they are flat; by giving them a spherical texture, you can make them appear to look no different than a normal sphere.
+
+The optional parent parameter allow you to specify a parent entity for the sprite so that when the parent is moved the child sprite will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the sprite being created at position 0,0,0 rather than at the parent entity's position.
+
+Note: Sprites have their own commands for rotation and scaling.
+
+
+See also: LoadSprite, RotateSprite, ScaleSprite, HandleSprite, SpriteViewMode, PositionEntity, MoveEntity, TranslateEntity, EntityAlpha, FreeEntity.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateSurface.htm b/_release/help/commands/3d_commands/CreateSurface.htm
index 14383e1..d3ae52f 100644
--- a/_release/help/commands/3d_commands/CreateSurface.htm
+++ b/_release/help/commands/3d_commands/CreateSurface.htm
@@ -1,45 +1,58 @@
-Command: CreateSurface
-
-
+Blitz3D Docs
+
-
-
-
Creates a surface attached to a mesh and returns the
- surface's handle.
Surfaces are sections of mesh which are then used to
- attach triangles to. You must have at least one surface per mesh in order to
- create a visible mesh, however you can use as many as you like. Splitting a
- mesh up into lots of sections allows you to affect those sections
- individually, which can be a lot more useful than if all the surfaces are
- combined into just one.
-
-
+
Description
+
+
+
+Creates a surface attached to a mesh and returns the surface's handle.
+
+Surfaces are sections of mesh which are then used to attach triangles to. You must have at least one surface per mesh in order to create a visible mesh, however you can use as many as you like. Splitting a mesh up into lots of sections allows you to affect those sections individually, which can be a lot more useful than if all the surfaces are combined into just one.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/CreateTerrain.htm b/_release/help/commands/3d_commands/CreateTerrain.htm
index ad69b95..85256b4 100644
--- a/_release/help/commands/3d_commands/CreateTerrain.htm
+++ b/_release/help/commands/3d_commands/CreateTerrain.htm
@@ -1,90 +1,83 @@
-Command: CreateTerrain
-
-
+Blitz3D Docs
+
-
-
-
CreateTerrain ( grid_size[,parent] )
-
-
-Parameters:
-
-
-
-
grid_size - no of grid squares along each side of terrain, and must be a
- power of 2
- parent (optional) - parent entity of terrain
-
+
CreateTerrain ( grid_size[,parent] )
+
Parameters
+
+
+
+grid_size - no of grid squares along each side of terrain, and must be a power of 2 value, e.g. 32, 64, 128, 256, 512, 1024.
+parent (optional) - parent entity of terrain
+
+
-
Description:
-
-
-
-
Creates a terrain entity and returns its handle.
The
- terrain extends from 0,0,0 to grid_size,1,grid_size.
-
A terrain is a special type of polygon object that uses real-time level
- of detail (LOD) to display landscapes which should theoretically consist of
- over a million polygons with only a few thousand. The way it does this is by
- constantly rearranging a certain amount of polygons to display high levels
- of detail close to the viewer and low levels further away.
-
This constant rearrangement of polygons is noticeable however, and is an
- well-known side-effect of all LOD landscapes. This 'pop-in' effect can be
- reduced though in lots of ways, as the other terrain help files will go on
- to explain.
-
The optional parent parameter allow you to specify a parent entity for
- the terrain so that when the parent is moved the child terrain will move
- with it. However, this relationship is one way; applying movement commands
- to the child will not affect the parent.
-
Specifying a parent entity will still result in the terrain being created
- at position 0,0,0 rather than at the parent entity's position.
+Creates a terrain entity and returns its handle.
+
+The terrain extends from 0,0,0 to grid_size,1,grid_size.
+
+A terrain is a special type of polygon object that uses real-time level of detail (LOD) to display landscapes which should theoretically consist of over a million polygons with only a few thousand. The way it does this is by constantly rearranging a certain amount of polygons to display high levels of detail close to the viewer and low levels further away.
+
+This constant rearrangement of polygons is occasionally noticeable however, and is a well-known side-effect of all LOD landscapes. This 'pop-in' effect can be reduced in lots of ways though, as the other terrain help files will go on to explain.
+
+The optional parent parameter allows you to specify a parent entity for the terrain so that when the parent is moved the child terrain will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
+
+Specifying a parent entity will still result in the terrain being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: LoadTerrain.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/CreateTexture.htm b/_release/help/commands/3d_commands/CreateTexture.htm
index 5d40f3a..fc57c92 100644
--- a/_release/help/commands/3d_commands/CreateTexture.htm
+++ b/_release/help/commands/3d_commands/CreateTexture.htm
@@ -1,136 +1,148 @@
-Command: CreateTexture
-
-
+Blitz3D Docs
+
-
-
-
CreateTexture (
-width,height[,flags][,frames] )
-
-
-Parameters:
-
-
-
-
width - width of texture
- height - height of texture
-
- flags (optional) - texture flag
- 1: Color
- 2: Alpha
- 4: Masked
- 8: Mipmapped
- 16: Clamp U
- 32: Clamp V
- 64: Spherical reflection map
-
- frames (optional) - no of frames texture will have
-
+
CreateTexture ( width,height[,flags][,frames] )
+
Parameters
+
+
+
+width - width of texture
+height - height of texture
+
+flags (optional) - texture flag:
+1: Color (default)
+2: Alpha
+4: Masked
+8: Mipmapped
+16: Clamp U
+32: Clamp V
+64: Spherical environment map
+128: Cubic environment map
+256: Store texture in vram
+512: Force the use of high color textures
+
+frames (optional) - no of frames texture will have. Defaults to 1.
+
+
-
Description:
-
-
-
-
Creates a texture and returns its handle.
Width and height are
- the size of the texture. Note that the actual texture size may be different
- from the width and height requested, as different types of 3D hardware
- support different sizes of texture.
The optional flags parameter allows
- you to apply certain effects to the texture. Flags can be added to combine
- two or more effects, eg. 3 (1+2) = texture with color and alpha maps.
Here
- are quick descriptions of the flags:
- 1: Color - color map, what you see is what you get.
- 2: Alpha - alpha map. If an image contains an alpha map, this will be used
- to make certain areas of the texture transparent. Otherwise, the color map
- will be used as an alpha map. With alpha maps, the dark areas always equal
- hihg-transparency, light areas equal low-transparency.
- 4: Masked - all areas of a texture coloured 0,0,0 will not be drawn to the
- screen.
- 8: Mipmapped - low detail versions of the texture will be used at high
- distance. Results in a smooth, blurred look.
- 16: Clamp u - clamp u texture co-ordinates. Prevents texture wrapping.
- 32: Clamp v - clamp v texture co-ordiantes. Prevents texture wrapping.
- 64: Spherical reflection map - environment mapping, for that shiny, teapot
- look.
Once you have created a texture, use
- SetBuffer
- TextureBuffer to draw to it. However, to
- display 2D graphics on a texture, it is usually quicker to draw to an image and then
- copy it to the texturebuffer, and to display 3D graphics on a texture, your
- only option is to copy from the backbuffer to the texturebuffer.
+Creates a texture and returns its handle.
+
+Width and height are the size of the texture. Note that the actual texture size may be different from the width and height requested, as different types of 3D hardware support different sizes of texture.
+
+The optional flags parameter allows you to apply certain effects to the texture. Flags can be added to combine two or more effects, e.g. 3 (1+2) = texture with color and alpha maps.
+
+Here some more detailed descriptions of the flags:
+
+1: Color - colour map, what you see is what you get.
+
+2: Alpha - alpha map. If an image contains an alpha map, this will be used to make certain areas of the texture transparent. Otherwise, the colour map will be used as an alpha map. With alpha maps, the dark areas always equal high-transparency, light areas equal low-transparency.
+
+4: Masked - all areas of a texture coloured 0,0,0 will not be drawn to the screen.
+
+8: Mipmapped - low detail versions of the texture will be used at high distance. Results in a smooth, blurred look.
+
+16: Clamp u - Any part of a texture that lies outsides the U coordinates of 0-1 will not be drawn. Prevents texture-wrapping.
+
+32: Clamp v - Any part of a texture that lies outsides the v coordinates of 0-1 will not be drawn. Prevents texture-wrapping.
+
+64: Spherical environment map - a form of environment mapping. This works by taking a single image, and then applying it to a 3D mesh in such a way that the image appears to be reflected. When used with a texture that contains light sources, it can give some meshes such as a teapot a shiny appearance.
+
+128: Cubic environment map - a form of environment mapping. Cube mapping is similar to spherical mapping, except it uses six images each representing a particular 'face' of an imaginary cube, to give the appearance of an image that perfectly reflects its surroundings.
+
+When creating cubic environment maps with the CreateTexture command, cubemap textures *must* be square 'power of 2' sizes. See the SetCubeFace command for information on how to then draw to the cubemap.
+
+When loading cubic environments maps into Blitz using LoadTexture, all six images relating to the six faces of the cube must be contained within the one texture, and be laid out in a horizontal strip in the following order - left, forward, right, backward, up, down. The images comprising the cubemap must all be power of two sizes.
+
+Please note that not some older graphics cards do not support cubic mapping. In order to find out if a user's graphics card can support it, use GfxDriverCaps3D .
+
+256: Store texture in vram. In some circumstances, this makes for much faster dynamic textures - ie. when using CopyRect between two textures. When drawing to cube maps in real-time, it is preferable to use this flag.
+
+512: Force the use of high color textures in low bit depth graphics modes. This is useful for when you are in 16-bit color mode, and wish to create/load textures with the alpha flag - it should give better results.
+
+Once you have created a texture, use SetBuffer TextureBuffer to draw to it. However, to display 2D graphics on a texture, it is usually quicker to draw to an image and then copy it to the texturebuffer, and to display 3D graphics on a texture, your only option is to copy from the backbuffer to the texturebuffer.
+
+
+See also: LoadTexture, LoadAnimTexture.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/Dither.htm b/_release/help/commands/3d_commands/Dither.htm
index 8bf4ed6..d46f2cd 100644
--- a/_release/help/commands/3d_commands/Dither.htm
+++ b/_release/help/commands/3d_commands/Dither.htm
@@ -1,79 +1,74 @@
-Command: Dither
-
-
+Blitz3D Docs
+
-
-
-
Dither enable
-
-
-Parameters:
-
-
-
-
enable - true to enable dithering, false to disable. Defaults to true.
-
+
Dither enable
+
Parameters
+
+
+
+enable - True to enable dithering, False to disable.
+
+The default Dither mode is True.
+
+
+
+
Description
+
+
+
+Enables or disables hardware dithering.
+
+Hardware dithering is useful when running games in 16-bit colour mode. Due to the fact that 16-bit mode offers less colours than the human eye can detect, separate bands of colour are often noticeable on shaded objects. However, hardware dithering will dither the entire screen to give the impression that more colours are being used than is actually the case.
+
+Due to the fact that 24-bit and 32-bit offer more colours than the human eye can detect, hardware dithering is made pretty much redundant in those modes.
+
+; Dither Example
+; --------------
+
+Graphics3D 640,480,16
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+; Rotate light so that it creates maximum shading effect on sphere
+RotateEntity light,90,0,0
+
+sphere=CreateSphere( 32 )
+PositionEntity sphere,0,0,2
+
+While Not KeyDown( 1 )
+
+; Toggle dither enable value between true and false when spacebar is pressed
+If KeyHit( 57 )=True Then enable=1-enable
+
+; Enable/disable hardware dithering
+Dither enable
+
+RenderWorld
+
+Text 0,0,"Press spacebar to toggle between Dither True/False"
+If enable=True Then Text 0,20,"Dither True" Else Text 0,20,"Dither False"
+
+Flip
+
+Wend
+
+End
+
+
-
Description:
-
-
-
-
Enables or disables hardware dithering.
-Hardware dithering is useful when running games in 16-bit colour mode. Due to
-the fact that 16-bit mode offers less colours than the human eye can
-distinguish, separate bands of colour are often noticeable on shaded objects.
-However, hardware dithering will dither the entire screen to give the impression
-that more colours are being used than is actually the case, and generally looks
-a lot better.
+Index
-Due to the fact that 24-bit and 32-bit offer more colours as the human eye can
-distinguish, hardware dithering is made pretty much redundant in those modes.
; Dither Example
- ; --------------
-
- Graphics3D 640,480,16
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- ; Rotate light so that it creates maximum shading effect on sphere
- RotateEntity light,90,0,0
-
- sphere=CreateSphere( 32 )
- PositionEntity sphere,0,0,2
-
- While Not KeyDown( 1 )
-
- ; Toggle dither enable value between true and false when spacebar is pressed
- If KeyHit( 57 )=True Then enable=1-enable
-
- ; Enable/disable hardware dithering
- Dither enable
-
- RenderWorld
-
- Text 0,0,"Press spacebar to toggle between Dither True/False"
- If enable=False Then Text 0,20,"Dither False" Else Text 0,20,"Dither True"
-
- Flip
-
- Wend
-
- End
+; EmitSound Example
+; -----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+cube_tex=LoadTexture("media/b3dlogo.jpg")
+EntityTexture cube,cube_tex
+PositionEntity cube,0,1,0
+
+microphone=CreateListener(camera) ; Create listener, make it child of camera
+sound=Load3DSound("media/ufo.wav") ; Load 3D sound
+
+While Not KeyDown(1)
+
+If KeyDown(205)=True Then TurnEntity camera,0,-1,0
+If KeyDown(203)=True Then TurnEntity camera,0,1,0
+If KeyDown(208)=True Then MoveEntity camera,0,0,-0.05
+If KeyDown(200)=True Then MoveEntity camera,0,0,0.05
+
+; If left mouse button hit then emit sound from cube
+If MouseHit(1) = True Then EmitSound(sound,cube)
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to make a sound be emitted from the cube"
+
+Flip
+
+Wend
+
+End
+
The alpha# value should be in the range 0-1.
- The default entity alpha setting is 1.
-
The alpha level is how
- transparent an entity is. A value of 1 will mean the entity is
- non-transparent, i.e. opaque. A value of 0 will mean the entity is
- completely transparent, i.e. invisible. Values between 0 and 1 will cause
- varying amount of transparency accordingly, useful for imitating the look of
- objects such as glass and ice.
-
An EntityAlpha value of 0 is especially useful as Blitz3D will not render
- entities with such a value, but will still involve the entities in collision
- tests. This is unlike
- HideEntity, which doesn't involve entities in
- collisions.
-
+
Description
+
+
+
+Sets the entity alpha level of an entity.
+
+The alpha# value should be in a floating point value in the range 0-1. The default entity alpha setting is 1.
+
+The alpha level is how transparent an entity is. A value of 1 will mean the entity is opaque. A value of 0 will mean the entity is completely transparent, i.e. invisible. Values between 0 and 1 will cause varying amount of transparency. This is useful for imitating the look of objects such as glass and other translucent materials.
+
+An EntityAlpha value of 0 is especially useful as Blitz3D will not render entities with such a value, but will still involve the entities in collision tests. This is unlike HideEntity, which doesn't involve entities in collisions.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/EntityAutoFade.htm b/_release/help/commands/3d_commands/EntityAutoFade.htm
index e35ea25..a9a195b 100644
--- a/_release/help/commands/3d_commands/EntityAutoFade.htm
+++ b/_release/help/commands/3d_commands/EntityAutoFade.htm
@@ -1,43 +1,30 @@
-Command: EntityAutoFade
-
-
+Blitz3D Docs
+
-
-
-
EntityAutoFade entity,near#,far#
-
-
-Parameters:
-
-
-
-
entity - entity handle
- near# - distance in front of the camera at which entity's will start being
- faded
- far# - distance in front of the camera at which entity's will stop being
- faded (and will be invisible)
-
+
EntityAutoFade entity,near#,far#
+
Parameters
+
+
+
+entity - entity handle
+near# - distance in front of the camera at which entity's will start being faded
+far# - distance in front of the camera at which entity's will stop being faded (and will be invisible)
+
+
-
Description:
-
-
-
-
Enables auto fading for an entity. This will cause an entity's alpha
- level to be adjusted at distances between near and far to create a 'fade-in'
- effect.
-
+
Description
+
+
+
+Enables auto fading for an entity. This will cause an entity's alpha level to be adjusted at distances between near and far to create a 'fade-in' effect.
+
+Entity - Entity handle
+
+Blend - Blend mode of the entity.
+1: Alpha (default)
+2: Multiply
+3: Add
+
+
-
Description:
-
-
-
-
Sets the blending mode of an entity.
-
+
Description
+
+
+
+Sets the blending mode of an entity. This blending mode determines the way in which the new RGBA of the pixel being rendered is combined with the RGB of the background.
+
+To calculate the new RGBA of the pixel being rendered, the texture RGBA for the pixel (see TextureBlend for more information on how the texture RGBA is calculated) is taken, its alpha component multiplied by the entities/brushes (where applicable) alpha value and its color compentent multiplied by the entities/brushes colour. This is the RGBA which will then be blended into the background pixel, and how this is done depends on the EntityBlend value.
+
+Alpha:
+This blends the pixels according to the Alpha value. This is rougly done to the formula:
+
+Rr = ( An * Rn ) + ( ( 1.0 - An ) * Ro )
+Gr = ( An * Gn ) + ( ( 1.0 - An ) * Go )
+Br = ( An * Bn ) + ( ( 1.0 - An ) * Bo )
+
+Where R = Red, G = Green, B = Blue, n = new pixel colour values, r = resultant colour values, o = old pixel colour values.
+
+Alpha blending is the default blending mode and is used with most world objects.
+
+Multiply:
+This blend mode will darken the underlying pixels. If you think of each RGB value as being on a scale from 0% to 100%, where 0 = 0% and 255 = 100%, the multiply blend mode will multiply the red, green and blue values individually together in order to get the new RGB value, roughly according to:
+
+Rr = ( ( Rn / 255.0 ) * ( Ro / 255.0 ) ) * 255.0
+Gr = ( ( Gn / 255.0 ) * ( Go / 255.0 ) ) * 255.0
+Br = ( ( Bn / 255.0 ) * ( Bo / 255.0 ) ) * 255.0
+
+The alpha value has no effect with multiplicative blending. Blending a RGB value of 255, 255, 255 will make no difference, while an RGB value of 128, 128, 128 will darken the pixels by a factor of 2 and an RGB value of 0, 0, 0 will completely blacken out the resultant pixels. An RGB value of 0, 255, 255 will remove the red component of the underlying pixel while leaving the other color values
+untouched.
+
+Multiply blending is most often used for lightmaps, shadows or anything else that needs to 'darken' the resultant pixels.
+
+Add:
+Additive blending will add the new color values to the old, roughly according to:
+
+Rr = ( Rn * An ) + Ro
+Gr = ( Gn * An ) + Go
+Br = ( Bn * An ) + Bo
+
+The resultant RGB values are clipped out at 255, meaning that multiple additive effects can quickly cause visible banding from smooth gradients.
+
+Additive blending is extremely useful for effects such as laser shots and fire.
+
+
+See also: TextureBlend, EntityAlpha.
+
+Graphics3D 640,480
+
+SetBuffer BackBuffer()
+
+SeedRnd MilliSecs()
+
+
+; create camera
+camera=CreateCamera()
+CameraClsColor camera,160,160,160
+PositionEntity camera,0,0,-30
+middle=CreatePivot()
+EntityParent camera,middle
+
+; create add texture - white cirlce on a black background
+For n=0 To 50
+Color 5+(n*5),5+(n*5),5+(n*5)
+Oval 10+n,10+n,236-(n*2),236-(n*2),1
+Next
+
+blob_tex=CreateTexture(256,256)
+blob=CreateImage(256,256)
+GrabImage blob,0,0
+CopyRect 0,0,256,256,0,0,ImageBuffer(blob),TextureBuffer(blob_tex)
+FreeImage blob
+
+max_blobs=100
+
+; create blobs using add blend mode
+Dim blobs(max_blobs) ; blob sprites
+Dim xyblobs#(max_blobs,2) ; blob vector
+
+For n=0 To max_blobs
+ blobs(n)=CreateSprite()
+ EntityFX blobs(n),1
+ EntityBlend blobs(n),3 ;set blend mode to add
+ EntityTexture blobs(n),blob_tex
+ xyblobs(n,0)=Rnd(-.1,.1)
+ xyblobs(n,1)=Rnd(-.1,.1)
+ xyblobs(n,2)=Rnd(-.1,.1)
+ EntityColor blobs(n),Rand(0,255),Rand(0,255),Rand(0,255) ;give it a colour
+ Next
+
+; create cube texture
+Color 255,255,255
+Rect 0,0,256,256,1
+For n=0 To 7
+ If n=0 Then Color 0,0,0
+ If n=1 Then Color 0,0,255
+ If n=2 Then Color 0,255,0
+ If n=3 Then Color 0,255,255
+ If n=4 Then Color 255,0,0
+ If n=5 Then Color 255,0,255
+ If n=6 Then Color 255,255,0
+ If n=7 Then Color 255,255,255
+ Rect n*32,n*32,32,32,1
+ Next
+Color 0,0,0
+For n=0 To 255 Step 32
+Line 0,n,255,n
+Line n,0,n,255
+Next
+
+cube_tex=CreateTexture(256,256)
+cube=CreateImage(256,256)
+GrabImage cube,0,0
+CopyRect 0,0,256,256,0,0,ImageBuffer(cube),TextureBuffer(cube_tex)
+FreeImage cube
+
+; create cube
+cube=CreateCube()
+ScaleEntity cube,11,11,11
+EntityTexture cube,cube_tex
+EntityFX cube,17 ;set fullbright and 2 sided textures
+EntityBlend cube,2 ;set multiply blend
+
+Repeat
+
+; move the blobs around
+For n=0 To max_blobs
+ MoveEntity blobs(n),xyblobs(n,0),xyblobs(n,1),xyblobs(n,2)
+ ;bounce off sides
+ If EntityX(blobs(n))<-10 Or EntityX(blobs(n))>10 Then xyblobs(n,0)=-xyblobs(n,0)
+ If EntityY(blobs(n))<-10 Or EntityY(blobs(n))>10 Then xyblobs(n,1)=-xyblobs(n,1)
+ If EntityZ(blobs(n))<-10 Or EntityZ(blobs(n))>10 Then xyblobs(n,2)=-xyblobs(n,2)
+ Next
+
+; turn camera
+TurnEntity middle,.1,.2,.3
+
+
+UpdateWorld
+RenderWorld
+Flip
+
+
+Until KeyHit(1)
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityBox.htm b/_release/help/commands/3d_commands/EntityBox.htm
index 1a172c4..f18f6d7 100644
--- a/_release/help/commands/3d_commands/EntityBox.htm
+++ b/_release/help/commands/3d_commands/EntityBox.htm
@@ -1,43 +1,37 @@
-Command: EntityBox
-
-
+Blitz3D Docs
+
-
-
-
EntityBox entity,x#,y#,z#,width#,height#,depth#
-
-
-Parameters:
-
-
-
-
entity - entity handle#
- x# - x position of entity's collision box
- y# - y position of entity's collision box
- z# - z position of entity's collision box
- width# - width of entity's collision box
- height# - height of entity's collision box
- depth# - depth of entity's collision box
-
+
EntityBox entity,x#,y#,z#,width#,height#,depth#
+
Parameters
+
+
+
+entity - entity handle#
+x# - x position of entity's collision box
+y# - y position of entity's collision box
+z# - z position of entity's collision box
+width# - width of entity's collision box
+height# - height of entity's collision box
+depth# - depth of entity's collision box
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityColor.htm b/_release/help/commands/3d_commands/EntityColor.htm
index 424fee3..8dd44f0 100644
--- a/_release/help/commands/3d_commands/EntityColor.htm
+++ b/_release/help/commands/3d_commands/EntityColor.htm
@@ -1,87 +1,86 @@
-Command: EntityColor
-
-
+Blitz3D Docs
+
-
-
-
EntityColor entity,red#,green#,blue#
-
-
-Parameters:
-
-
-
-
entity - entity handle
- red# - red value of entity
- green# - green value of entity
- blue# - blue value of entity
-
+
EntityColor entity,red#,green#,blue#
+
Parameters
+
+
+
+entity - entity handle
+Red# - red value of entity
+Green# - green value of entity
+Blue# - blue value of entity
+
+
-
Description:
-
-
-
-
Sets the color of an entity.
The green, red and blue values should be
- in the range 0-255. The default entity color is 255,255,255.
-
-
+
Description
+
+
+
+Sets the color of an entity.
+
+The Red, Green and Blue values should be in the range 0-255 with 0 being darkest and 255 brightest. The default entity color is 255,255,255 (White).
+
; EntityColor Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Set initial entity color values
- red#=255
- green#=255
- blue#=255
-
- While Not KeyDown( 1 )
-
- ; Change red, green, blue values depending on key pressed
- If KeyDown( 2 )=True And red#>0 Then red#=red#-1
- If KeyDown( 3 )=True And red#<255 Then red#=red#+1
- If KeyDown( 4 )=True And green#>0 Then green#=green#-1
- If KeyDown( 5 )=True And green#<255 Then green#=green#+1
- If KeyDown( 6 )=True And blue#>0 Then blue#=blue#-1
- If KeyDown( 7 )=True And blue#<255 Then blue#=blue#+1
-
- ; Set entity color using red, green, blue values
- EntityColor cube,red#,green#,blue#
-
- TurnEntity cube,0.1,0.1,0.1
-
- RenderWorld
-
- Text 0,0,"Press keys 1-6 to change EntityColor red#,green#,blue# values
- Text 0,20,"Entity Red: "+red#
- Text 0,40,"Entity Green: "+green#
- Text 0,60,"Entity Blue: "+blue#
-
- Flip
-
- Wend
-
- End
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/EntityDistance.htm b/_release/help/commands/3d_commands/EntityDistance.htm
index 7a731ce..240dc19 100644
--- a/_release/help/commands/3d_commands/EntityDistance.htm
+++ b/_release/help/commands/3d_commands/EntityDistance.htm
@@ -1,38 +1,29 @@
-Command: EntityDistance
-
-
+Blitz3D Docs
+
-
-
-
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityFX.htm b/_release/help/commands/3d_commands/EntityFX.htm
index 73225cf..d4d6821 100644
--- a/_release/help/commands/3d_commands/EntityFX.htm
+++ b/_release/help/commands/3d_commands/EntityFX.htm
@@ -1,45 +1,44 @@
-Command: EntityFX
-
-
+Blitz3D Docs
+
-
-
-
EntityFX entity,fx
-
-
-Parameters:
-
-
-
-
entity - entity handle
-
- fx -
- 1: full-bright
- 2: use vertex colors instead of brush color
- 4: flatshaded
- 8: disable fog
-
+
EntityFX entity,fx
+
Parameters
+
+
+
+entity - entity handle
+
+fx -
+0: nothing (default)
+1: full-bright
+2: use vertex colors instead of brush color
+4: flatshaded
+8: disable fog
+16: disable backface culling
+32: force alpha-blending
+
+
-
Description:
-
-
-
-
Sets miscellaneous effects for an entity.
Flags can be added to combine
- two or more effects. For example, specifying a flag of 3 (1+2) will result
- in a full-bright and vertex-coloured brush.
-
+
Description
+
+
+
+Sets miscellaneous effects for an entity.
+
+Flags can be added to combine two or more effects. For example, specifying a flag of 3 (1+2) will result in a full-bright and vertex-coloured brush.
+
+Flag 32, to force alpha-blending, must be used in order to enable vertex alpha (see VertexColor).
+
+
+See also: VertexColor.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityInView.htm b/_release/help/commands/3d_commands/EntityInView.htm
index d867de2..4d0a2c2 100644
--- a/_release/help/commands/3d_commands/EntityInView.htm
+++ b/_release/help/commands/3d_commands/EntityInView.htm
@@ -1,41 +1,93 @@
-Command: EntityInView
-
-
+Blitz3D Docs
+
-
-
-
EntityInView ( entity,camera )
-
-
-Parameters:
-
-
-
-
entity - entity handle
- camera - camera handle
-
+
EntityInView ( entity,camera )
+
Parameters
+
+
+
+entity - entity handle
+camera - camera handle
+
+
-
Description:
-
-
-
-
Returns true if the specified entity is visible to the specified camera.
- If the entity is a mesh, its bounding box will be checked for visibility.
-
For all other types of entities, only their centre position will be
- checked.
-
+
Description
+
+
+
+Returns true if the specified entity is visible to the specified camera.
+
+If the entity is a mesh, its bounding box will be checked for visibility.
+
+For all other types of entities, only their centre position will be checked.
+
+; EntityInView Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+cube_tex=LoadTexture("media/b3dlogo.jpg")
+EntityTexture cube,cube_tex
+PositionEntity cube,0,1,0
+
+While Not KeyDown( 1 )
+
+If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
+If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
+If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
+
+; Use camera project to get 2D coordinates from 3D coordinates of cube
+CameraProject(camera,EntityX(cube),EntityY(cube),EntityZ(cube))
+
+RenderWorld
+
+; If cube is in view then draw text, if not then draw nothing otherwise text will be drawn at 0,0
+If EntityInView(cube,camera)=True
+
+; Use ProjectedX() and ProjectedY() to get 2D coordinates from when CameraProject was used.
+; Use these coordinates to draw text at a 2D position, on top of a 3D scene.
+Text ProjectedX#(),ProjectedY#(),"Cube"
+
+EndIf
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"ProjectedX: "+ProjectedX#()
+Text 0,40,"ProjectedY: "+ProjectedY#()
+Text 0,60,"ProjectedZ: "+ProjectedZ#()
+Text 0,80,"EntityInView: "+EntityInView(cube,camera)
+
+Flip
+
+Wend
+
+End
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityOrder.htm b/_release/help/commands/3d_commands/EntityOrder.htm
index 8fd0b9f..6b7668f 100644
--- a/_release/help/commands/3d_commands/EntityOrder.htm
+++ b/_release/help/commands/3d_commands/EntityOrder.htm
@@ -1,45 +1,35 @@
-Command: EntityOrder
-
-
+Blitz3D Docs
+
-
-
-
EntityOrder entity,order
-
-
-Parameters:
-
-
-
-
entity - entity handle
- order - order that entity will be drawn in
-
+
EntityOrder entity,order
+
Parameters
+
+
+
+entity - entity handle
+order - order that entity will be drawn in
+
+
-
Description:
-
-
-
-
Sets the drawing order for an entity.
An order value of 0 will mean
- the entity is drawn normally. A value greater than 0 will mean that entity
- is drawn first, behind everything else. A value less than 0 will mean the
- entity is drawn last, in front of everything else.
-
Setting an entity's order to
- non-0 also disables z-buffering for the entity, so should be only used for
- simple, convex entities like skyboxes, sprites etc.
EntityOrder affects
- the specified entity but none of its child entities, if any exist.
-
+
Description
+
+
+
+Sets the drawing order for an entity.
+
+An order value of 0 will mean the entity is drawn normally. A value greater than 0 will mean that entity is drawn first, behind everything else. A value less than 0 will mean the entity is drawn last, in front of everything else.
+
+Setting an entity's order to non-0 also disables z-buffering for the entity, so should be only used for simple, convex entities like skyboxes, sprites etc.
+
+EntityOrder affects the specified entity but none of its child entities, if any exist.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/EntityParent.htm b/_release/help/commands/3d_commands/EntityParent.htm
index c81a409..5f9e186 100644
--- a/_release/help/commands/3d_commands/EntityParent.htm
+++ b/_release/help/commands/3d_commands/EntityParent.htm
@@ -1,41 +1,32 @@
-Command: EntityParent
-
-
+Blitz3D Docs
+
-
-
-
EntityParent entity,parent[,global]
-
-
-Parameters:
-
-
-
-
entity - entity handle
- parent - parent entity handle
- global (optional) - true for the child entity to retain its global position
- and orientation. Defaults to true.
-
+
EntityParent entity,parent[,global]
+
Parameters
+
+
+
+entity - entity handle
+parent - parent entity handle
+global (optional) - true for the child entity to retain its global position and orientation. Defaults to true.
+
+
-
Description:
-
-
-
-
Attaches an entity to a parent.
Parent may be 0, in which case the
- entity will have no parent.
-
+
Description
+
+
+
+Attaches an entity to a parent.
+
+Parent may be 0, in which case the entity will have no parent.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityPick.htm b/_release/help/commands/3d_commands/EntityPick.htm
index 66a913c..8b37103 100644
--- a/_release/help/commands/3d_commands/EntityPick.htm
+++ b/_release/help/commands/3d_commands/EntityPick.htm
@@ -1,40 +1,32 @@
-Command: EntityPick
-
-
+Blitz3D Docs
+
-
-
-
EntityPick ( entity,range# )
-
-
-Parameters:
-
-
-
-
entity - entity handle
- range# - range of pick area around entity
-
+
EntityPick ( entity,range# )
+
Parameters
+
+
+
+entity - entity handle
+range# - range of pick area around entity
+
+
-
Description:
-
-
-
-
Returns the nearest entity 'ahead' of the specified entity. An entity
- must have a non-zero EntityPickMode to be
- pickable.
-
+
Description
+
+
+
+Returns the nearest entity 'ahead' of the specified entity. An entity must have a non-zero EntityPickMode to be pickable.
+
+
+See also: EntityPick, LinePick, CameraPick, EntityPickMode.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/EntityPickMode.htm b/_release/help/commands/3d_commands/EntityPickMode.htm
index 2ec4395..024de59 100644
--- a/_release/help/commands/3d_commands/EntityPickMode.htm
+++ b/_release/help/commands/3d_commands/EntityPickMode.htm
@@ -1,47 +1,43 @@
-Command: EntityPickMode
-
-
+Blitz3D Docs
+
-
-
-
EntityPickMode
-entity,pick_geometry,obscurer
-
-
-Parameters:
-
-
-
-
entity - entity handle
-
- pick_geometry - type of geometry used for picking:
- 0: Unpickable (default)
- 1: Sphere (EntityRadius is used)
- 2: Polygon
- 3: Box (EntityBox is used)
-
- obscurer - true to determine that the entity 'obscures' other entities
- during an EntityVisible call.
-
+
EntityPickMode entity,pick_geometry[,obscurer]
+
Parameters
+
+
+
+entity - entity handle
+
+pick_geometry - type of geometry used for picking:
+0: Unpickable (default)
+1: Sphere (EntityRadius is used)
+2: Polygon
+3: Box (EntityBox is used)
+
+obscurer (optional) - True to determine that the entity 'obscures' other entities during an EntityVisible call. Defaults to True.
+
+
-
Description:
-
-
-
-
Sets the pick mode for an entity.
-
+
Description
+
+
+
+Sets the pick mode for an entity.
+
+The optional obscurer parameter is used with EntityVisible to determine just what can get in the way of the line-of-sight between 2 entities. This allows some entities to be pickable using the other pick commands, but to be ignored (i.e. 'transparent') when using EntityVisible. So, its very much EntityVisible specific.
+
+Please note that only Sphere and Box picking will work with Blitz3D sprites. For polygon picking, you will need a valid mesh.
+
+
+See also: EntityPick, LinePick, CameraPick, EntityPickMode.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityPitch.htm b/_release/help/commands/3d_commands/EntityPitch.htm
index 7958354..e84e02f 100644
--- a/_release/help/commands/3d_commands/EntityPitch.htm
+++ b/_release/help/commands/3d_commands/EntityPitch.htm
@@ -1,79 +1,77 @@
-Command: EntityPitch
-
-
+Blitz3D Docs
+
-
-
-
EntityPitch# ( entity[,global] )
-
-
-Parameters:
-
-
-
-
entity - name of entity that will have pitch angle returned
-global (optional) - true if the pitch angle returned should be relative to 0 rather than a parent entity's
-pitch angle. False by default.
-
+
EntityPitch# ( entity[,global] )
+
Parameters
+
+
+
+entity - name of entity that will have pitch angle returned
+global (optional) - true if the pitch angle returned should be relative to 0 rather than a parent entity's pitch angle. False by default.
+
+
+
+
Description
+
+
+
+Returns the pitch angle of an entity.
+
+The pitch angle is also the x angle of an entity.
+
+entity - entity handle
+x_radius# - x radius of entity's collision ellipsoid
+y_radius# (optional) - y radius of entity's collision ellipsoid. If omitted the x_radius# will be used for the y_radius#.
+
+
-
Description:
-
-
-
-
Sets the radius of an entity's collision sphere.
An entity radius
- should be set for all entities involved in spherical collisions, which is
- all source entities (as collisions are always sphere-to-something), and
- whatever destination entities are involved in sphere-to-sphere collisions
- (collision method No.1).
-
+
Description
+
+
+
+Sets the radius of an entity's collision ellipsoid.
+
+An entity radius should be set for all entities involved in ellipsoidal collisions, which is all source entities (as collisions are always ellipsoid-to-something), and whatever destination entities are involved in ellipsoid-to-ellipsoid collisions (collision method No.1).
+
+
+See also: EntityBox, Collisions, EntityType.
+
-
+
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityRoll.htm b/_release/help/commands/3d_commands/EntityRoll.htm
index 0e00bcc..763e4a6 100644
--- a/_release/help/commands/3d_commands/EntityRoll.htm
+++ b/_release/help/commands/3d_commands/EntityRoll.htm
@@ -1,79 +1,77 @@
-Command: EntityPitch
-
-
+Blitz3D Docs
+
-
-
-
EntityRoll# ( entity[,global] )
-
-
-Parameters:
-
-
-
-
entity - name of entity that will have roll angle returned
-global (optional) - true if the roll angle returned should be relative to 0 rather than a parent entity's
- roll angle. False by default.
-
+
EntityRoll# ( entity[,global] )
+
Parameters
+
+
+
+entity - name of entity that will have roll angle returned
+global (optional) - true if the roll angle returned should be relative to 0 rather than a parent entity's roll angle. False by default.
+
+
+
+
Description
+
+
+
+Returns the roll angle of an entity.
+
+The roll angle is also the z angle of an entity.
+
-
+Index
+
+Click here to view the latest version of this page online
diff --git a/_release/help/commands/3d_commands/EntityShininess.htm b/_release/help/commands/3d_commands/EntityShininess.htm
index 8ab21ba..fa97027 100644
--- a/_release/help/commands/3d_commands/EntityShininess.htm
+++ b/_release/help/commands/3d_commands/EntityShininess.htm
@@ -1,43 +1,79 @@
-Command: EntityShininess
-
-
+Blitz3D Docs
+
-
-
-
EntityShininess entity,shininess#
-
-
-Parameters:
-
-
-
-
entity - entity handle
- shininess# - shininess of entity
-
+
EntityShininess Entity, Shininess#
+
Parameters
+
+
+
+Entity - entity handle
+Shininess# - shininess of entity
+
+
-
Description:
-
-
-
-
Sets the specular shininess of an entity.
The shininess# value should be in the range 0-1.
- The default shininess setting is 0.
Shininess is how much brighter certain
- areas of an object will appear to be when a light is shone directly at them.
-
Setting a shininess value of 1 for a medium to high poly sphere, combined
- with the creation of a light shining in the direction of it, will give it
- the appearance of a shiny snooker ball.
-
+
Description
+
+
+
+Sets the specular shininess of an entity.
+
+The shininess# value should be a floting point number in the range 0-1. The default shininess setting is 0.
+
+Shininess is how much brighter certain areas of an object will appear to be when a light is shone directly at them.
+
+Setting a shininess value of 1 for a medium to high poly sphere, combined with the creation of a light shining in the direction of it, will give it the appearance of a shiny snooker ball.
+
-
-
\ No newline at end of file
+
+Index
+
+Click here to view the latest version of this page online
+
diff --git a/_release/help/commands/3d_commands/EntityTexture.htm b/_release/help/commands/3d_commands/EntityTexture.htm
index cafc299..813c397 100644
--- a/_release/help/commands/3d_commands/EntityTexture.htm
+++ b/_release/help/commands/3d_commands/EntityTexture.htm
@@ -1,85 +1,85 @@
-Command: EntityTexture
-
-
+Blitz3D Docs
+
-
-
-
EntityTexture entity,texture[,frame][,index]
-
-
-Parameters:
-
-
-
-
entity - entity handle
- texture - texture handle
- frame (optional) - frame of texture
- index (optional) - index of layer to be textured.
-
+
EntityTexture entity,texture[,frame][,index]
+
Parameters
+
+
+
+entity - entity handle
+texture - texture handle
+frame (optional) - frame of texture. Defaults to 0.
+index (optional) - index number of texture. Should be in the range to 0-7. Defaults to 0.
+
+
-
Description:
-
-
-
-
Sets the texture of an entity.
The optional frame parameter specifies
- which texture animation frame, if any exist, should be used as the texture.
- Defaults to 0.
-
The optional index parameter specifies which texture layer the texture
- should use. There are four available texture layers, 0-3
- inclusive. Defaults to 0.