From bb0f822db31ae668f905f3f587964302eff92f30 Mon Sep 17 00:00:00 2001 From: blitz-research Date: Mon, 8 Dec 2014 12:43:20 +1300 Subject: [PATCH] Applied docspak188. --- _release/help/commands/2d_commands/ACos.htm | 93 +- _release/help/commands/2d_commands/ASin.htm | 93 +- _release/help/commands/2d_commands/ATan.htm | 98 +- _release/help/commands/2d_commands/ATan2.htm | 107 +- _release/help/commands/2d_commands/Abs.htm | 42 +- .../commands/2d_commands/AcceptTCPStream.htm | 142 +- _release/help/commands/2d_commands/After.htm | 130 +- _release/help/commands/2d_commands/And.htm | 54 +- .../help/commands/2d_commands/AppTitle.htm | 40 +- _release/help/commands/2d_commands/Asc.htm | 40 +- .../help/commands/2d_commands/AvailVidMem.htm | 37 +- .../help/commands/2d_commands/BackBuffer.htm | 70 +- .../help/commands/2d_commands/BankSize.htm | 66 +- _release/help/commands/2d_commands/Before.htm | 130 +- _release/help/commands/2d_commands/Bin.htm | 39 +- _release/help/commands/2d_commands/Case.htm | 84 +- _release/help/commands/2d_commands/Ceil.htm | 93 +- .../help/commands/2d_commands/ChangeDir.htm | 42 +- .../help/commands/2d_commands/ChannelPan.htm | 115 +- .../commands/2d_commands/ChannelPitch.htm | 113 +- .../commands/2d_commands/ChannelPlaying.htm | 60 +- .../commands/2d_commands/ChannelVolume.htm | 115 +- _release/help/commands/2d_commands/Chr.htm | 37 +- .../help/commands/2d_commands/CloseDir.htm | 92 +- .../help/commands/2d_commands/CloseFile.htm | 127 +- .../commands/2d_commands/CloseTCPServer.htm | 138 +- .../commands/2d_commands/CloseTCPStream.htm | 83 +- _release/help/commands/2d_commands/Cls.htm | 40 +- .../help/commands/2d_commands/ClsColor.htm | 40 +- _release/help/commands/2d_commands/Color.htm | 66 +- .../help/commands/2d_commands/ColorBlue.htm | 62 +- .../help/commands/2d_commands/ColorGreen.htm | 62 +- .../help/commands/2d_commands/ColorRed.htm | 62 +- .../help/commands/2d_commands/CommandLine.htm | 68 +- _release/help/commands/2d_commands/Const.htm | 52 +- .../help/commands/2d_commands/CopyBank.htm | 75 +- .../help/commands/2d_commands/CopyFile.htm | 49 +- .../help/commands/2d_commands/CopyImage.htm | 50 +- .../help/commands/2d_commands/CopyPixel.htm | 114 +- .../commands/2d_commands/CopyPixelFast.htm | 122 +- .../help/commands/2d_commands/CopyRect.htm | 94 +- .../help/commands/2d_commands/CopyStream.htm | 54 +- _release/help/commands/2d_commands/Cos.htm | 125 +- .../commands/2d_commands/CountGFXModes.htm | 57 +- .../commands/2d_commands/CountGfxDrivers.htm | 67 +- .../help/commands/2d_commands/CreateBank.htm | 73 +- .../help/commands/2d_commands/CreateDir.htm | 43 +- .../help/commands/2d_commands/CreateImage.htm | 114 +- .../commands/2d_commands/CreateNetPlayer.htm | 87 +- .../commands/2d_commands/CreateTCPServer.htm | 142 +- .../help/commands/2d_commands/CreateTimer.htm | 46 +- .../help/commands/2d_commands/CurrentDate.htm | 40 +- .../help/commands/2d_commands/CurrentDir.htm | 44 +- .../help/commands/2d_commands/CurrentTime.htm | 40 +- _release/help/commands/2d_commands/Data.htm | 82 +- .../help/commands/2d_commands/DebugLog.htm | 64 +- .../help/commands/2d_commands/Default.htm | 80 +- _release/help/commands/2d_commands/Delay.htm | 40 +- _release/help/commands/2d_commands/Delete.htm | 64 +- .../help/commands/2d_commands/DeleteDir.htm | 39 +- .../help/commands/2d_commands/DeleteFile.htm | 38 +- .../commands/2d_commands/DeleteNetPlayer.htm | 96 +- _release/help/commands/2d_commands/Dim.htm | 94 +- .../help/commands/2d_commands/DrawBlock.htm | 92 +- .../commands/2d_commands/DrawBlockRect.htm | 104 +- .../help/commands/2d_commands/DrawImage.htm | 100 +- .../commands/2d_commands/DrawImageRect.htm | 97 +- _release/help/commands/2d_commands/EOF.htm | 67 +- _release/help/commands/2d_commands/Each.htm | 52 +- .../help/commands/2d_commands/Else If.htm | 65 +- _release/help/commands/2d_commands/Else.htm | 52 +- _release/help/commands/2d_commands/ElseIf.htm | 55 +- .../commands/2d_commands/End Function.htm | 60 +- _release/help/commands/2d_commands/End If.htm | 64 +- .../help/commands/2d_commands/End Select.htm | 82 +- .../help/commands/2d_commands/End Type.htm | 53 +- _release/help/commands/2d_commands/End.htm | 42 +- .../help/commands/2d_commands/EndGraphics.htm | 71 +- _release/help/commands/2d_commands/EndIF.htm | 62 +- .../help/commands/2d_commands/ExecFile.htm | 72 +- _release/help/commands/2d_commands/Exit.htm | 47 +- _release/help/commands/2d_commands/Exp.htm | 70 +- _release/help/commands/2d_commands/False.htm | 68 +- _release/help/commands/2d_commands/Field.htm | 90 +- .../help/commands/2d_commands/FilePos.htm | 161 +- .../help/commands/2d_commands/FileSize.htm | 48 +- .../help/commands/2d_commands/FileType.htm | 64 +- _release/help/commands/2d_commands/First.htm | 130 +- _release/help/commands/2d_commands/Flip.htm | 77 +- _release/help/commands/2d_commands/Float.htm | 72 +- _release/help/commands/2d_commands/Floor.htm | 96 +- .../help/commands/2d_commands/FlushJoy.htm | 49 +- .../help/commands/2d_commands/FlushKeys.htm | 40 +- .../help/commands/2d_commands/FlushMouse.htm | 49 +- .../help/commands/2d_commands/FontHeight.htm | 75 +- .../help/commands/2d_commands/FontWidth.htm | 75 +- _release/help/commands/2d_commands/For.htm | 58 +- .../help/commands/2d_commands/Forever.htm | 50 +- .../help/commands/2d_commands/FreeBank.htm | 64 +- .../help/commands/2d_commands/FreeFont.htm | 112 +- .../help/commands/2d_commands/FreeImage.htm | 74 +- .../help/commands/2d_commands/FreeSound.htm | 46 +- .../help/commands/2d_commands/FreeTimer.htm | 58 +- .../help/commands/2d_commands/FrontBuffer.htm | 74 +- .../help/commands/2d_commands/Function.htm | 122 +- .../commands/2d_commands/GFXModeDepth.htm | 57 +- .../commands/2d_commands/GFXModeHeight.htm | 57 +- .../commands/2d_commands/GFXModeWidth.htm | 57 +- .../help/commands/2d_commands/GetColor.htm | 65 +- _release/help/commands/2d_commands/GetJoy.htm | 50 +- _release/help/commands/2d_commands/GetKey.htm | 49 +- .../help/commands/2d_commands/GetMouse.htm | 50 +- .../commands/2d_commands/GfxDriverName.htm | 73 +- .../commands/2d_commands/GfxModeExists.htm | 63 +- _release/help/commands/2d_commands/Global.htm | 40 +- _release/help/commands/2d_commands/Gosub.htm | 60 +- _release/help/commands/2d_commands/Goto.htm | 56 +- .../help/commands/2d_commands/GrabImage.htm | 123 +- .../help/commands/2d_commands/Graphics.htm | 88 +- .../commands/2d_commands/GraphicsBuffer.htm | 61 +- .../commands/2d_commands/GraphicsDepth.htm | 61 +- .../commands/2d_commands/GraphicsHeight.htm | 61 +- .../commands/2d_commands/GraphicsWidth.htm | 61 +- .../help/commands/2d_commands/HandleImage.htm | 63 +- _release/help/commands/2d_commands/Hex.htm | 39 +- .../help/commands/2d_commands/HidePointer.htm | 92 +- .../help/commands/2d_commands/HostNetGame.htm | 53 +- _release/help/commands/2d_commands/If.htm | 62 +- .../help/commands/2d_commands/ImageBuffer.htm | 113 +- .../help/commands/2d_commands/ImageHeight.htm | 69 +- .../commands/2d_commands/ImageRectCollide.htm | 157 +- .../commands/2d_commands/ImageRectOverlap.htm | 155 +- .../help/commands/2d_commands/ImageWidth.htm | 69 +- .../commands/2d_commands/ImageXHandle.htm | 129 +- .../commands/2d_commands/ImageYHandle.htm | 129 +- .../commands/2d_commands/ImagesCollide.htm | 163 +- .../commands/2d_commands/ImagesOverlap.htm | 163 +- .../help/commands/2d_commands/Include.htm | 65 +- _release/help/commands/2d_commands/Input.htm | 42 +- _release/help/commands/2d_commands/Insert.htm | 83 +- _release/help/commands/2d_commands/Instr.htm | 46 +- _release/help/commands/2d_commands/Int.htm | 108 +- .../help/commands/2d_commands/JoinNetGame.htm | 71 +- .../help/commands/2d_commands/JoyDown.htm | 56 +- _release/help/commands/2d_commands/JoyHit.htm | 58 +- .../help/commands/2d_commands/JoyType.htm | 61 +- _release/help/commands/2d_commands/JoyX.htm | 45 +- .../help/commands/2d_commands/JoyXDir.htm | 47 +- _release/help/commands/2d_commands/JoyY.htm | 45 +- .../help/commands/2d_commands/JoyYDir.htm | 47 +- _release/help/commands/2d_commands/JoyZ.htm | 46 +- .../help/commands/2d_commands/JoyZDir.htm | 47 +- .../help/commands/2d_commands/KeyDown.htm | 56 +- _release/help/commands/2d_commands/KeyHit.htm | 56 +- _release/help/commands/2d_commands/LSet.htm | 41 +- _release/help/commands/2d_commands/Last.htm | 130 +- _release/help/commands/2d_commands/Left.htm | 41 +- _release/help/commands/2d_commands/Len.htm | 39 +- _release/help/commands/2d_commands/Line.htm | 59 +- .../commands/2d_commands/LoadAnimImage.htm | 126 +- .../help/commands/2d_commands/LoadBuffer.htm | 60 +- .../help/commands/2d_commands/LoadFont.htm | 122 +- .../help/commands/2d_commands/LoadImage.htm | 89 +- .../help/commands/2d_commands/LoadSound.htm | 53 +- _release/help/commands/2d_commands/Local.htm | 63 +- _release/help/commands/2d_commands/Locate.htm | 53 +- .../help/commands/2d_commands/LockBuffer.htm | 98 +- _release/help/commands/2d_commands/Log.htm | 79 +- _release/help/commands/2d_commands/Log10.htm | 66 +- .../help/commands/2d_commands/LoopSound.htm | 57 +- _release/help/commands/2d_commands/Lower.htm | 42 +- .../help/commands/2d_commands/MaskImage.htm | 105 +- _release/help/commands/2d_commands/Mid.htm | 47 +- .../help/commands/2d_commands/Millisecs.htm | 43 +- _release/help/commands/2d_commands/Mod.htm | 41 +- .../help/commands/2d_commands/MouseDown.htm | 54 +- .../help/commands/2d_commands/MouseHit.htm | 56 +- _release/help/commands/2d_commands/MouseX.htm | 85 +- .../help/commands/2d_commands/MouseXSpeed.htm | 94 +- _release/help/commands/2d_commands/MouseY.htm | 85 +- .../help/commands/2d_commands/MouseYSpeed.htm | 94 +- _release/help/commands/2d_commands/MouseZ.htm | 80 +- .../help/commands/2d_commands/MouseZSpeed.htm | 105 +- .../help/commands/2d_commands/MoveMouse.htm | 68 +- .../help/commands/2d_commands/NetMsgData.htm | 125 +- .../commands/2d_commands/NetPlayerLocal.htm | 132 +- .../commands/2d_commands/NetPlayerName.htm | 125 +- _release/help/commands/2d_commands/New.htm | 70 +- _release/help/commands/2d_commands/Next.htm | 46 +- .../help/commands/2d_commands/NextFile.htm | 89 +- _release/help/commands/2d_commands/Not.htm | 48 +- _release/help/commands/2d_commands/Null.htm | 51 +- .../help/commands/2d_commands/OpenFile.htm | 121 +- .../commands/2d_commands/OpenTCPStream.htm | 93 +- _release/help/commands/2d_commands/Or.htm | 50 +- _release/help/commands/2d_commands/Origin.htm | 57 +- _release/help/commands/2d_commands/Oval.htm | 61 +- .../commands/2d_commands/PauseChannel.htm | 112 +- .../help/commands/2d_commands/PeekByte.htm | 69 +- .../help/commands/2d_commands/PeekFloat.htm | 69 +- .../help/commands/2d_commands/PeekInt.htm | 69 +- .../help/commands/2d_commands/PeekShort.htm | 69 +- _release/help/commands/2d_commands/Pi.htm | 40 +- .../help/commands/2d_commands/PlayCDTrack.htm | 78 +- .../help/commands/2d_commands/PlayMusic.htm | 46 +- .../help/commands/2d_commands/PlaySound.htm | 55 +- _release/help/commands/2d_commands/Plot.htm | 46 +- .../help/commands/2d_commands/PokeByte.htm | 70 +- .../help/commands/2d_commands/PokeFloat.htm | 70 +- .../help/commands/2d_commands/PokeInt.htm | 70 +- .../help/commands/2d_commands/PokeShort.htm | 70 +- _release/help/commands/2d_commands/Print.htm | 45 +- _release/help/commands/2d_commands/RSet.htm | 41 +- _release/help/commands/2d_commands/Rand.htm | 55 +- _release/help/commands/2d_commands/Read.htm | 94 +- .../help/commands/2d_commands/ReadAvail.htm | 84 +- .../help/commands/2d_commands/ReadByte.htm | 152 +- .../help/commands/2d_commands/ReadBytes.htm | 125 +- .../help/commands/2d_commands/ReadDir.htm | 89 +- .../help/commands/2d_commands/ReadFile.htm | 129 +- .../help/commands/2d_commands/ReadFloat.htm | 114 +- .../help/commands/2d_commands/ReadInt.htm | 116 +- .../help/commands/2d_commands/ReadLine.htm | 127 +- .../help/commands/2d_commands/ReadPixel.htm | 125 +- .../commands/2d_commands/ReadPixelFast.htm | 149 +- .../help/commands/2d_commands/ReadShort.htm | 116 +- .../help/commands/2d_commands/ReadString.htm | 122 +- _release/help/commands/2d_commands/Rect.htm | 78 +- .../commands/2d_commands/RectsOverlap.htm | 151 +- .../help/commands/2d_commands/RecvNetMsg.htm | 119 +- _release/help/commands/2d_commands/Repeat.htm | 46 +- .../help/commands/2d_commands/Replace.htm | 46 +- .../help/commands/2d_commands/ResizeBank.htm | 70 +- .../help/commands/2d_commands/ResizeImage.htm | 77 +- .../help/commands/2d_commands/Restore.htm | 84 +- .../commands/2d_commands/ResumeChannel.htm | 97 +- _release/help/commands/2d_commands/Return.htm | 75 +- _release/help/commands/2d_commands/Right.htm | 43 +- _release/help/commands/2d_commands/Rnd.htm | 40 +- .../help/commands/2d_commands/RotateImage.htm | 109 +- .../commands/2d_commands/RuntimeError.htm | 39 +- _release/help/commands/2d_commands/Sar.htm | 76 +- .../help/commands/2d_commands/SaveBuffer.htm | 47 +- .../help/commands/2d_commands/SaveImage.htm | 77 +- .../help/commands/2d_commands/ScaleImage.htm | 78 +- .../help/commands/2d_commands/ScanLine.htm | 46 +- .../help/commands/2d_commands/SeedRnd.htm | 36 +- .../help/commands/2d_commands/SeekFile.htm | 158 +- _release/help/commands/2d_commands/Select.htm | 87 +- .../help/commands/2d_commands/SendNetMsg.htm | 218 +- .../help/commands/2d_commands/SetBuffer.htm | 36 +- .../help/commands/2d_commands/SetFont.htm | 120 +- .../commands/2d_commands/SetGfxDriver.htm | 73 +- _release/help/commands/2d_commands/Sgn.htm | 47 +- _release/help/commands/2d_commands/Shl.htm | 75 +- .../help/commands/2d_commands/ShowPointer.htm | 92 +- _release/help/commands/2d_commands/Shr.htm | 75 +- _release/help/commands/2d_commands/Sin.htm | 126 +- .../help/commands/2d_commands/SoundPan.htm | 50 +- .../help/commands/2d_commands/SoundPitch.htm | 63 +- .../help/commands/2d_commands/SoundVolume.htm | 54 +- _release/help/commands/2d_commands/Sqr.htm | 43 +- .../commands/2d_commands/StartNetGame.htm | 57 +- _release/help/commands/2d_commands/Step.htm | 43 +- _release/help/commands/2d_commands/Stop.htm | 41 +- .../help/commands/2d_commands/StopChannel.htm | 116 +- .../help/commands/2d_commands/StopNetGame.htm | 61 +- _release/help/commands/2d_commands/Str.htm | 46 +- _release/help/commands/2d_commands/String.htm | 44 +- .../commands/2d_commands/StringHeight.htm | 46 +- .../help/commands/2d_commands/StringWidth.htm | 46 +- .../commands/2d_commands/SystemProperty.htm | 88 +- .../help/commands/2d_commands/TCPTimeOuts.htm | 92 +- .../help/commands/2d_commands/TFormFilter.htm | 95 +- _release/help/commands/2d_commands/Tan.htm | 109 +- _release/help/commands/2d_commands/Text.htm | 63 +- _release/help/commands/2d_commands/Then.htm | 62 +- .../help/commands/2d_commands/TileBlock.htm | 61 +- .../help/commands/2d_commands/TileImage.htm | 117 +- _release/help/commands/2d_commands/To.htm | 43 +- .../help/commands/2d_commands/TotalVidMem.htm | 60 +- _release/help/commands/2d_commands/Trim.htm | 46 +- _release/help/commands/2d_commands/True.htm | 64 +- _release/help/commands/2d_commands/Type.htm | 161 +- .../commands/2d_commands/UnlockBuffer.htm | 99 +- _release/help/commands/2d_commands/Until.htm | 46 +- _release/help/commands/2d_commands/Upper.htm | 40 +- _release/help/commands/2d_commands/VWait.htm | 64 +- .../help/commands/2d_commands/Viewport.htm | 79 +- .../help/commands/2d_commands/WaitJoy.htm | 64 +- .../help/commands/2d_commands/WaitKey.htm | 60 +- .../help/commands/2d_commands/WaitMouse.htm | 60 +- .../help/commands/2d_commands/WaitTimer.htm | 53 +- _release/help/commands/2d_commands/Wend.htm | 47 +- _release/help/commands/2d_commands/While.htm | 47 +- _release/help/commands/2d_commands/Write.htm | 45 +- .../help/commands/2d_commands/WriteByte.htm | 157 +- .../help/commands/2d_commands/WriteBytes.htm | 123 +- .../help/commands/2d_commands/WriteFile.htm | 130 +- .../help/commands/2d_commands/WriteFloat.htm | 116 +- .../help/commands/2d_commands/WriteInt.htm | 116 +- .../help/commands/2d_commands/WriteLine.htm | 120 +- .../help/commands/2d_commands/WritePixel.htm | 107 +- .../commands/2d_commands/WritePixelFast.htm | 133 +- .../help/commands/2d_commands/WriteShort.htm | 116 +- .../help/commands/2d_commands/WriteString.htm | 124 +- _release/help/commands/2d_commands/Xor.htm | 80 +- .../help/commands/3d_commands/AddAnimSeq.htm | 114 +- .../help/commands/3d_commands/AddTriangle.htm | 105 +- .../help/commands/3d_commands/AddVertex.htm | 127 +- .../commands/3d_commands/AlignToVector.htm | 69 +- .../commands/3d_commands/AmbientLight.htm | 165 +- .../help/commands/3d_commands/AnimLength.htm | 51 +- .../help/commands/3d_commands/AnimSeq.htm | 51 +- .../help/commands/3d_commands/AnimTime.htm | 51 +- .../help/commands/3d_commands/Animate.htm | 89 +- .../help/commands/3d_commands/AnimateMD2.htm | 149 +- .../help/commands/3d_commands/Animating.htm | 51 +- .../help/commands/3d_commands/AntiAlias.htm | 136 +- .../help/commands/3d_commands/BrushAlpha.htm | 72 +- .../help/commands/3d_commands/BrushBlend.htm | 59 +- .../help/commands/3d_commands/BrushColor.htm | 157 +- .../help/commands/3d_commands/BrushFX.htm | 69 +- .../commands/3d_commands/BrushShininess.htm | 66 +- .../commands/3d_commands/BrushTexture.htm | 164 +- .../commands/3d_commands/CameraClsColor.htm | 101 +- .../commands/3d_commands/CameraClsMode.htm | 112 +- .../commands/3d_commands/CameraFogColor.htm | 165 +- .../commands/3d_commands/CameraFogMode.htm | 155 +- .../commands/3d_commands/CameraFogRange.htm | 162 +- .../help/commands/3d_commands/CameraPick.htm | 127 +- .../commands/3d_commands/CameraProject.htm | 116 +- .../help/commands/3d_commands/CameraRange.htm | 107 +- .../commands/3d_commands/CameraViewport.htm | 157 +- .../help/commands/3d_commands/CameraZoom.htm | 114 +- .../commands/3d_commands/CaptureWorld.htm | 110 +- .../commands/3d_commands/ClearCollisions.htm | 188 +- .../commands/3d_commands/ClearSurface.htm | 69 +- .../3d_commands/ClearTextureFilters.htm | 108 +- .../help/commands/3d_commands/ClearWorld.htm | 62 +- .../commands/3d_commands/CollisionEntity.htm | 58 +- .../help/commands/3d_commands/CollisionNX.htm | 64 +- .../help/commands/3d_commands/CollisionNY.htm | 64 +- .../help/commands/3d_commands/CollisionNZ.htm | 64 +- .../commands/3d_commands/CollisionSurface.htm | 57 +- .../commands/3d_commands/CollisionTime.htm | 57 +- .../3d_commands/CollisionTriangle.htm | 57 +- .../help/commands/3d_commands/CollisionX.htm | 64 +- .../help/commands/3d_commands/CollisionY.htm | 64 +- .../help/commands/3d_commands/CollisionZ.htm | 64 +- .../help/commands/3d_commands/Collisions.htm | 366 +- .../help/commands/3d_commands/CopyEntity.htm | 104 +- .../commands/3d_commands/CountChildren.htm | 61 +- .../commands/3d_commands/CountCollisions.htm | 55 +- .../commands/3d_commands/CountSurfaces.htm | 57 +- .../commands/3d_commands/CountTriangles.htm | 53 +- .../commands/3d_commands/CountVertices.htm | 53 +- .../help/commands/3d_commands/CreateBrush.htm | 180 +- .../commands/3d_commands/CreateCamera.htm | 116 +- .../help/commands/3d_commands/CreateCone.htm | 145 +- .../help/commands/3d_commands/CreateCube.htm | 122 +- .../commands/3d_commands/CreateCylinder.htm | 145 +- .../help/commands/3d_commands/CreateLight.htm | 133 +- .../commands/3d_commands/CreateListener.htm | 111 +- .../help/commands/3d_commands/CreateMesh.htm | 137 +- .../commands/3d_commands/CreateMirror.htm | 163 +- .../help/commands/3d_commands/CreatePivot.htm | 106 +- .../help/commands/3d_commands/CreatePlane.htm | 152 +- .../commands/3d_commands/CreateSphere.htm | 140 +- .../commands/3d_commands/CreateSprite.htm | 106 +- .../commands/3d_commands/CreateSurface.htm | 87 +- .../commands/3d_commands/CreateTerrain.htm | 159 +- .../commands/3d_commands/CreateTexture.htm | 268 +- _release/help/commands/3d_commands/Dither.htm | 137 +- .../help/commands/3d_commands/EmitSound.htm | 105 +- .../help/commands/3d_commands/EntityAlpha.htm | 123 +- .../commands/3d_commands/EntityAutoFade.htm | 59 +- .../help/commands/3d_commands/EntityBlend.htm | 203 +- .../help/commands/3d_commands/EntityBox.htm | 66 +- .../commands/3d_commands/EntityCollided.htm | 57 +- .../help/commands/3d_commands/EntityColor.htm | 159 +- .../commands/3d_commands/EntityDistance.htm | 53 +- .../help/commands/3d_commands/EntityFX.htm | 75 +- .../commands/3d_commands/EntityInView.htm | 118 +- .../help/commands/3d_commands/EntityName.htm | 55 +- .../help/commands/3d_commands/EntityOrder.htm | 68 +- .../commands/3d_commands/EntityParent.htm | 59 +- .../help/commands/3d_commands/EntityPick.htm | 60 +- .../commands/3d_commands/EntityPickMode.htm | 76 +- .../help/commands/3d_commands/EntityPitch.htm | 142 +- .../commands/3d_commands/EntityRadius.htm | 200 +- .../help/commands/3d_commands/EntityRoll.htm | 142 +- .../commands/3d_commands/EntityShininess.htm | 108 +- .../commands/3d_commands/EntityTexture.htm | 154 +- .../help/commands/3d_commands/EntityType.htm | 61 +- .../commands/3d_commands/EntityVisible.htm | 53 +- .../help/commands/3d_commands/EntityX.htm | 240 +- .../help/commands/3d_commands/EntityY.htm | 222 +- .../help/commands/3d_commands/EntityYaw.htm | 142 +- .../help/commands/3d_commands/EntityZ.htm | 222 +- .../help/commands/3d_commands/FindChild.htm | 54 +- .../help/commands/3d_commands/FindSurface.htm | 58 +- .../help/commands/3d_commands/FitMesh.htm | 154 +- .../help/commands/3d_commands/FlipMesh.htm | 144 +- .../help/commands/3d_commands/FreeBrush.htm | 51 +- .../help/commands/3d_commands/FreeEntity.htm | 100 +- .../help/commands/3d_commands/FreeTexture.htm | 156 +- .../help/commands/3d_commands/GetChild.htm | 54 +- .../commands/3d_commands/GetEntityType.htm | 54 +- .../help/commands/3d_commands/GetParent.htm | 51 +- .../help/commands/3d_commands/GetSurface.htm | 65 +- .../help/commands/3d_commands/GfxDriver3D.htm | 75 +- .../help/commands/3d_commands/GfxMode3D.htm | 75 +- .../help/commands/3d_commands/Graphics3D.htm | 126 +- .../help/commands/3d_commands/HWMultiTex.htm | 70 +- .../commands/3d_commands/HandleSprite.htm | 81 +- .../help/commands/3d_commands/HideEntity.htm | 68 +- .../help/commands/3d_commands/LightColor.htm | 96 +- .../commands/3d_commands/LightConeAngles.htm | 86 +- .../help/commands/3d_commands/LightMesh.htm | 90 +- .../help/commands/3d_commands/LightRange.htm | 93 +- .../help/commands/3d_commands/LinePick.htm | 68 +- .../help/commands/3d_commands/Load3DSound.htm | 100 +- .../commands/3d_commands/LoadAnimMesh.htm | 97 +- .../help/commands/3d_commands/LoadAnimSeq.htm | 56 +- .../commands/3d_commands/LoadAnimTexture.htm | 144 +- .../help/commands/3d_commands/LoadBrush.htm | 77 +- .../help/commands/3d_commands/LoadMD2.htm | 136 +- .../help/commands/3d_commands/LoadMesh.htm | 120 +- .../help/commands/3d_commands/LoadSprite.htm | 98 +- .../help/commands/3d_commands/LoadTerrain.htm | 199 +- .../help/commands/3d_commands/LoadTexture.htm | 198 +- .../commands/3d_commands/LoaderMatrix.htm | 89 +- .../commands/3d_commands/MD2AnimLength.htm | 131 +- .../help/commands/3d_commands/MD2AnimTime.htm | 141 +- .../commands/3d_commands/MD2Animating.htm | 139 +- .../help/commands/3d_commands/MeshDepth.htm | 55 +- .../help/commands/3d_commands/MeshHeight.htm | 55 +- .../help/commands/3d_commands/MeshWidth.htm | 55 +- .../commands/3d_commands/MeshesIntersect.htm | 129 +- .../commands/3d_commands/ModifyTerrain.htm | 136 +- .../help/commands/3d_commands/MoveEntity.htm | 170 +- .../help/commands/3d_commands/NameEntity.htm | 56 +- .../help/commands/3d_commands/PaintEntity.htm | 58 +- .../help/commands/3d_commands/PaintMesh.htm | 174 +- .../commands/3d_commands/PaintSurface.htm | 62 +- .../commands/3d_commands/PickedEntity.htm | 114 +- .../help/commands/3d_commands/PickedNX.htm | 112 +- .../help/commands/3d_commands/PickedNY.htm | 112 +- .../help/commands/3d_commands/PickedNZ.htm | 112 +- .../commands/3d_commands/PickedSurface.htm | 112 +- .../help/commands/3d_commands/PickedTime.htm | 112 +- .../commands/3d_commands/PickedTriangle.htm | 112 +- .../help/commands/3d_commands/PickedX.htm | 119 +- .../help/commands/3d_commands/PickedY.htm | 119 +- .../help/commands/3d_commands/PickedZ.htm | 119 +- .../help/commands/3d_commands/PointEntity.htm | 64 +- .../commands/3d_commands/PositionEntity.htm | 165 +- .../commands/3d_commands/PositionMesh.htm | 106 +- .../commands/3d_commands/PositionTexture.htm | 165 +- .../help/commands/3d_commands/ProjectedX.htm | 110 +- .../help/commands/3d_commands/ProjectedY.htm | 110 +- .../help/commands/3d_commands/ProjectedZ.htm | 110 +- .../help/commands/3d_commands/RenderWorld.htm | 75 +- .../help/commands/3d_commands/ResetEntity.htm | 54 +- .../commands/3d_commands/RotateEntity.htm | 154 +- .../help/commands/3d_commands/RotateMesh.htm | 109 +- .../commands/3d_commands/RotateSprite.htm | 75 +- .../commands/3d_commands/RotateTexture.htm | 155 +- .../help/commands/3d_commands/ScaleEntity.htm | 162 +- .../help/commands/3d_commands/ScaleMesh.htm | 106 +- .../help/commands/3d_commands/ScaleSprite.htm | 77 +- .../commands/3d_commands/ScaleTexture.htm | 161 +- .../help/commands/3d_commands/SetAnimKey.htm | 122 +- .../help/commands/3d_commands/ShowEntity.htm | 66 +- .../commands/3d_commands/SpriteViewMode.htm | 142 +- .../help/commands/3d_commands/TFormNormal.htm | 89 +- .../help/commands/3d_commands/TFormPoint.htm | 145 +- .../help/commands/3d_commands/TFormVector.htm | 163 +- .../help/commands/3d_commands/TFormedX.htm | 67 +- .../help/commands/3d_commands/TFormedY.htm | 67 +- .../help/commands/3d_commands/TFormedZ.htm | 67 +- .../commands/3d_commands/TerrainDetail.htm | 217 +- .../commands/3d_commands/TerrainHeight.htm | 136 +- .../commands/3d_commands/TerrainShading.htm | 194 +- .../help/commands/3d_commands/TerrainSize.htm | 175 +- .../help/commands/3d_commands/TerrainX.htm | 185 +- .../help/commands/3d_commands/TerrainY.htm | 188 +- .../help/commands/3d_commands/TerrainZ.htm | 184 +- .../commands/3d_commands/TextureBlend.htm | 152 +- .../commands/3d_commands/TextureBuffer.htm | 193 +- .../commands/3d_commands/TextureCoords.htm | 60 +- .../commands/3d_commands/TextureFilter.htm | 136 +- .../commands/3d_commands/TextureHeight.htm | 89 +- .../commands/3d_commands/TextureWidth.htm | 89 +- .../commands/3d_commands/TranslateEntity.htm | 181 +- .../commands/3d_commands/TriangleVertex.htm | 58 +- .../help/commands/3d_commands/TurnEntity.htm | 163 +- .../commands/3d_commands/UpdateNormals.htm | 52 +- .../help/commands/3d_commands/UpdateWorld.htm | 62 +- .../help/commands/3d_commands/VertexBlue.htm | 55 +- .../help/commands/3d_commands/VertexColor.htm | 67 +- .../commands/3d_commands/VertexCoords.htm | 67 +- .../help/commands/3d_commands/VertexGreen.htm | 55 +- .../help/commands/3d_commands/VertexNX.htm | 55 +- .../help/commands/3d_commands/VertexNY.htm | 55 +- .../help/commands/3d_commands/VertexNZ.htm | 55 +- .../commands/3d_commands/VertexNormal.htm | 61 +- .../help/commands/3d_commands/VertexRed.htm | 55 +- .../commands/3d_commands/VertexTexCoords.htm | 63 +- .../help/commands/3d_commands/VertexU.htm | 58 +- .../help/commands/3d_commands/VertexV.htm | 58 +- .../help/commands/3d_commands/VertexW.htm | 55 +- .../help/commands/3d_commands/VertexX.htm | 55 +- .../help/commands/3d_commands/VertexY.htm | 55 +- .../help/commands/3d_commands/VertexZ.htm | 55 +- .../help/commands/3d_commands/WBuffer.htm | 73 +- .../help/commands/3d_commands/Windowed3D.htm | 79 +- .../help/commands/3d_commands/Wireframe.htm | 135 +- .../help/commands/3d_examples/AddAnimSeq.bb | 58 +- .../help/commands/3d_examples/AddTriangle.bb | 27 +- .../help/commands/3d_examples/AddVertex.bb | 26 +- .../help/commands/3d_examples/AmbientLight.bb | 30 +- .../help/commands/3d_examples/AnimateMD2.bb | 6 +- .../help/commands/3d_examples/AntiAlias.bb | 16 +- .../help/commands/3d_examples/BrushColor.bb | 26 +- .../help/commands/3d_examples/BrushTexture.bb | 26 +- .../commands/3d_examples/CameraClsColor.bb | 35 +- .../commands/3d_examples/CameraClsMode.bb | 48 +- .../commands/3d_examples/CameraFogColor.bb | 52 +- .../commands/3d_examples/CameraFogMode.bb | 28 +- .../commands/3d_examples/CameraFogRange.bb | 38 +- .../help/commands/3d_examples/CameraPick.bb | 52 +- .../commands/3d_examples/CameraProject.bb | 49 +- .../help/commands/3d_examples/CameraRange.bb | 40 +- .../commands/3d_examples/CameraViewport.bb | 22 +- .../help/commands/3d_examples/CameraZoom.bb | 54 +- .../help/commands/3d_examples/CaptureWorld.bb | 51 +- .../commands/3d_examples/ClearCollisions.bb | 50 +- .../3d_examples/ClearTextureFilters.bb | 60 +- .../help/commands/3d_examples/Collisions.bb | 122 +- .../help/commands/3d_examples/CopyEntity.bb | 44 +- .../commands/3d_examples/CountChildren.bb | 25 +- .../help/commands/3d_examples/CreateBrush.bb | 28 +- .../help/commands/3d_examples/CreateCamera.bb | 4 +- .../help/commands/3d_examples/CreateCone.bb | 4 +- .../help/commands/3d_examples/CreateCube.bb | 4 +- .../commands/3d_examples/CreateCylinder.bb | 4 +- .../help/commands/3d_examples/CreateLight.bb | 23 +- .../commands/3d_examples/CreateListener.bb | 40 +- .../help/commands/3d_examples/CreateMesh.bb | 69 +- .../help/commands/3d_examples/CreateMirror.bb | 26 +- .../help/commands/3d_examples/CreatePivot.bb | 28 +- .../help/commands/3d_examples/CreatePlane.bb | 20 +- .../help/commands/3d_examples/CreateSphere.bb | 4 +- .../help/commands/3d_examples/CreateSprite.bb | 23 +- .../commands/3d_examples/CreateSurface.bb | 42 +- .../commands/3d_examples/CreateTexture.bb | 32 +- _release/help/commands/3d_examples/Dither.bb | 16 +- .../help/commands/3d_examples/EmitSound.bb | 40 +- .../help/commands/3d_examples/EntityAlpha.bb | 41 +- .../help/commands/3d_examples/EntityBlend.bb | 101 +- .../help/commands/3d_examples/EntityColor.bb | 38 +- .../help/commands/3d_examples/EntityInView.bb | 49 +- .../help/commands/3d_examples/EntityPitch.bb | 36 +- .../help/commands/3d_examples/EntityRadius.bb | 60 +- .../help/commands/3d_examples/EntityRoll.bb | 34 +- .../commands/3d_examples/EntityShininess.bb | 37 +- .../commands/3d_examples/EntityTexture.bb | 26 +- _release/help/commands/3d_examples/EntityX.bb | 139 +- _release/help/commands/3d_examples/EntityY.bb | 139 +- .../help/commands/3d_examples/EntityYaw.bb | 34 +- _release/help/commands/3d_examples/EntityZ.bb | 139 +- _release/help/commands/3d_examples/FitMesh.bb | 69 +- .../help/commands/3d_examples/FlipMesh.bb | 8 +- .../help/commands/3d_examples/FreeEntity.bb | 42 +- .../help/commands/3d_examples/FreeTexture.bb | 38 +- .../help/commands/3d_examples/GfxDriver3D.bb | 15 +- .../help/commands/3d_examples/GfxMode3D.bb | 16 +- .../help/commands/3d_examples/Graphics3D.bb | 7 +- .../help/commands/3d_examples/HandleSprite.bb | 28 +- .../help/commands/3d_examples/LightColor.bb | 25 +- .../commands/3d_examples/LightConeAngles.bb | 26 +- .../help/commands/3d_examples/LightMesh.bb | 28 +- .../help/commands/3d_examples/LightRange.bb | 30 +- .../help/commands/3d_examples/Load3DSound.bb | 40 +- .../help/commands/3d_examples/LoadAnimMesh.bb | 27 +- .../commands/3d_examples/LoadAnimTexture.bb | 34 +- _release/help/commands/3d_examples/LoadMD2.bb | 4 +- .../help/commands/3d_examples/LoadMesh.bb | 4 +- .../help/commands/3d_examples/LoadSprite.bb | 24 +- .../help/commands/3d_examples/LoadTerrain.bb | 45 +- .../help/commands/3d_examples/LoadTexture.bb | 28 +- .../commands/3d_examples/MD2AnimLength.bb | 14 +- .../help/commands/3d_examples/MD2AnimTime.bb | 18 +- .../help/commands/3d_examples/MD2Animating.bb | 26 +- .../commands/3d_examples/MeshesIntersect.bb | 18 +- .../commands/3d_examples/ModifyTerrain.bb | 66 +- .../help/commands/3d_examples/MoveEntity.bb | 48 +- .../help/commands/3d_examples/PaintMesh.bb | 28 +- .../help/commands/3d_examples/PickedEntity.bb | 52 +- .../help/commands/3d_examples/PickedNX.bb | 50 +- .../help/commands/3d_examples/PickedNY.bb | 50 +- .../help/commands/3d_examples/PickedNZ.bb | 50 +- .../commands/3d_examples/PickedSurface.bb | 52 +- .../help/commands/3d_examples/PickedTime.bb | 52 +- .../commands/3d_examples/PickedTriangle.bb | 52 +- _release/help/commands/3d_examples/PickedX.bb | 52 +- _release/help/commands/3d_examples/PickedY.bb | 52 +- _release/help/commands/3d_examples/PickedZ.bb | 52 +- .../commands/3d_examples/PositionEntity.bb | 32 +- .../help/commands/3d_examples/PositionMesh.bb | 37 +- .../commands/3d_examples/PositionTexture.bb | 32 +- .../help/commands/3d_examples/ProjectedX.bb | 49 +- .../help/commands/3d_examples/ProjectedY.bb | 49 +- .../help/commands/3d_examples/ProjectedZ.bb | 49 +- .../help/commands/3d_examples/RotateEntity.bb | 32 +- .../help/commands/3d_examples/RotateMesh.bb | 40 +- .../help/commands/3d_examples/RotateSprite.bb | 24 +- .../commands/3d_examples/RotateTexture.bb | 28 +- .../help/commands/3d_examples/ScaleEntity.bb | 32 +- .../help/commands/3d_examples/ScaleMesh.bb | 37 +- .../help/commands/3d_examples/ScaleSprite.bb | 24 +- .../help/commands/3d_examples/ScaleTexture.bb | 32 +- .../help/commands/3d_examples/SetAnimKey.bb | 58 +- .../commands/3d_examples/SpriteViewMode.bb | 59 +- .../help/commands/3d_examples/TFormNormal.bb | 28 +- .../help/commands/3d_examples/TFormPoint.bb | 54 +- .../help/commands/3d_examples/TFormVector.bb | 65 +- .../commands/3d_examples/TerrainDetail.bb | 72 +- .../commands/3d_examples/TerrainHeight.bb | 91 +- .../commands/3d_examples/TerrainShading.bb | 62 +- .../help/commands/3d_examples/TerrainSize.bb | 54 +- .../help/commands/3d_examples/TerrainX.bb | 54 +- .../help/commands/3d_examples/TerrainY.bb | 54 +- .../help/commands/3d_examples/TerrainZ.bb | 54 +- .../help/commands/3d_examples/TextureBlend.bb | 64 +- .../commands/3d_examples/TextureBuffer.bb | 26 +- .../commands/3d_examples/TextureFilter.bb | 60 +- .../commands/3d_examples/TextureHeight.bb | 41 +- .../help/commands/3d_examples/TextureWidth.bb | 41 +- .../commands/3d_examples/TranslateEntity.bb | 51 +- .../help/commands/3d_examples/TurnEntity.bb | 40 +- .../help/commands/3d_examples/Windowed3D.bb | 11 +- .../help/commands/3d_examples/Wireframe.bb | 16 +- _release/help/commands/command_list.htm | 5306 +---------------- _release/help/commands/css/commands.css | 58 +- _release/help/commands/index.htm | 11 +- _release/help/commands/scancodes.htm | 303 +- 649 files changed, 33093 insertions(+), 23947 deletions(-) diff --git a/_release/help/commands/2d_commands/ACos.htm b/_release/help/commands/2d_commands/ACos.htm index 47b49a2..9c35ebf 100644 --- a/_release/help/commands/2d_commands/ACos.htm +++ b/_release/help/commands/2d_commands/ACos.htm @@ -1,38 +1,61 @@ -Command: ACos   ACos (number)  

Definition:

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. +
+

Example

+ + + + +
+; 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)
-

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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.
-

Example:

; Set graphics w/double buffering
-Graphics 640,480,16,0
-SetBuffer BackBuffer()
+ + +Blitz3D Docs + + + +

ATan# ( t# )

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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
-

Index

+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 +
+

Example

+ + + + +
+; ATan2 example.
+
+; Move mouse. Escape quits.
+
+Const width = 640, height = 480
+Const radius# = .2 * height
+Const KEY_ESC = 1
+
+Graphics width, height
+SetBuffer BackBuffer( )
+Origin width / 2, height / 2
+HidePointer
+MoveMouse .75 * width, height / 2
+
+While Not KeyDown( KEY_ESC )
+
+Cls
+
+Color 255, 255, 0
+Line 0, 0, width / 2, 0 ; positive x-axis
+
+x = MouseX() - width / 2
+y = MouseY() - height / 2
+
+Oval x - 3, y - 3, 7, 7, True
+Line 0, 0, x, y
+
+Text .35 * width, -80, "x = " + x
+Text .35 * width, -60, "y = " + y
+
+Text .35 * width - 96, -40, "ATan2( y, x ) = " + ATan2( y, x )
+
+Flip
+
+Wend
+
+End +

-; 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
-

Index

+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. +
+

Example

+ + + + +
+number=-3
+
+Print "The absolute value of " + number + " is: " + Abs(number)
+
+WaitKey()
+ +

-Print "The absolute value of " + number + " is: " + Abs(number)
+Index

-WaitKey()
-

Index

+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. +
+

Example

+ + + + +
+; 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 ---
+ +

-See CreateTCPServer and CloseTCPServer.

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 ---
-

Index

+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

-

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

+ + +Blitz3D Docs + + + +

After custom_type_variable

+

Parameters

+ + + + +
+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. +
+

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
+
+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
-

Index

+See also: Or, Not, Xor. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; Set the title bar
+
+AppTitle "Super Invaders V1.0", "Are you sure?" +

-AppTitle "Super Invaders V1.0"
-

Index

+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$)
-

Index

+ + +Blitz3D Docs + + + +

Asc (string$)

+

Parameters

+ + + + +
+string$ = any valid string variable (only the first character's ASCII value will be returned). +
+

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$)
+ +
+
+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()

Index

+ + +Blitz3D Docs + + + +

AvailVidMem()

+

Parameters

+ + + + +
+None. +
+

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()
+ +
+
+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.

Example:

; Flip/Backbuffer()/Rect Example
+ + +Blitz3D Docs + + + +

BackBuffer()

+

Parameters

+ + + + +
+None. +
+

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. +
+

Example

+ + + + +
+; 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
+ +

-; Set Graphics Mode
-Graphics 640,480
+Index

-; 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
-

Index

+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.

Command Description:

Use this command to determing the size of an existing bank. See CreateBank, ResizeBank, and CopyBank.

Example:

; BankSize, ResizeBank, CopyBank Example
+ + +Blitz3D Docs + + + +

BankSize (bankhandle)

+

Parameters

+ + + + +
+bankhandle - handle assigned to the bank when created. +
+

Description

+ + + + +
+Use this command to determine the size of an existing bank.
-; create a bank
-bnkTest=CreateBank(5000)

-; Fill it with rand Integers
-For t = 0 To 4999
-PokeByte bnkTest,t,Rand(9)
-Next
+See also: CreateBank, ResizeBank, CopyBank. +
+

Example

+ + + + +
+; 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)
-

Index

+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

-

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

+ + +Blitz3D Docs + + + +

Before custom_type_variable

+

Parameters

+ + + + +
+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. +
+

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
+
+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)

Index

+ + +Blitz3D Docs + + + +

Bin$ (integer)

+

Parameters

+ + + + +
+integer = any valid integer or integer variable +
+

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)
+ +
+
+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

Example

+ + + + +
+; Ceil / Floor / Int example, three kinds of rounding.
+
+; Move mouse. Escape quits.
+
+Graphics 640, 480
+
+Const KEY_ESC = 1
+
+SetBuffer BackBuffer()
+Origin 320, 240
+
+MoveMouse 320, 240 : HidePointer
+
+While Not KeyDown( KEY_ESC )
+
+Cls
+
+my = MouseY() - 240
+Color 100, 100, 0
+Line -320, my, 319, my
+
+DrawNumberLine
+
+y# = Float( -my ) / 32
+
+Text 100, 50, " y = " + y
+Text 100, 70, " Ceil( y ) = " + Ceil( y )
+Text 100, 90, " Floor( y ) = " + Floor( y )
+Text 100, 110, " Int( y ) = " + Int( y )
+
+Flip
+
+Wend
+End
+
+Function DrawNumberLine( ) ; vertical line with numeric labels
+
+Color 255, 255, 255
+Line 0, -240, 0, 239
+
+For n = -7 To 7
+yn = -32 * n
+Line -2, yn, 2, yn
+Text -30, yn - 6, RSet( n, 2 )
+Next
+
+End Function +

-; Set a floating point variable
-myVal#=0.5
+Index

-; Round it up
-Print Floor#(myval)
-
-;Round it down
-Print Ceil#(myval)
-

Index

+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. +
+

Example

+ + + + +
+; ChangeDir example
+
+ChangeDir "c:winntsystem32"
+Print "The folder has been changed to: " + currentdir$() +

-ChangeDir "c:\winnt\system32"
-Print "The folder has been changed to: " + currentdir$()

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; Channel examples
+Index

-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

Index

+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. +
+

Example

+ + + + +
+; 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

-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

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. +
+

Example

+ + + + +
+; 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.

Example:

; Channel examples
+Index

-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!"

Index

+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! +
+

Example

+ + + + +
+; 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!

Example:

; Channel examples
+Index

-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

Index

+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)

Index

+ + +Blitz3D Docs + + + +

Chr$ (integer)

+

Parameters

+ + + + +
+integer = valid ASCII code integer value +
+

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)
+ +
+
+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! -

Example:

; ReadDir/NextFile$/CloseDir example
+ + +Blitz3D Docs + + + +

CloseDir filehandle

+

Parameters

+ + + + +
+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$ +
+

Example

+ + + + +
+; 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!"
-

Index

+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. +
+

Example

+ + + + +
+; Reading and writing custom types to files using ReadFile, WriteFile and CloseFile
+
+; Initialise some variables for the example
+Type HighScore
+Field Name$
+Field Score%
+Field Level%
+End Type
+
+Best.HighScore = New HighScore
+BestName = "Mark"
+BestScore = 11657
+BestLevel = 34
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteString( fileout, BestName )
+WriteInt( fileout, BestScore )
+WriteByte( fileout, BestLevel )
+
+; 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
+GreatestName$ = ReadString$( filein )
+GreatestScore = ReadInt( filein )
+GreatestLevel = ReadByte( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "High score record read from - mydata.dat "
+Print
+Write "Name = "
+Print GreatestName
+Write "Score = "
+Print GreatestScore
+Write "Level = "
+Print GreatestLevel
+
+WaitKey() +

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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 ---
-

Index

+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.

Example:

; OpenTCPStream/CloseTCPStream Example
+ + +Blitz3D Docs + + + +

CloseTCPStream streamhandle

+

Parameters

+ + + + +
+streamhandle = handle assigned when the stream was opened. +
+

Description

+ + + + +
+Once you've completed the use of your TCP/IP stream, close the connection you opened with OpenTCPStream with this command. +
+

Example

+ + + + +
+; OpenTCPStream/CloseTCPStream Example
+
+Print "Connecting..."
+tcp=OpenTCPStream( "www.blitzbasement.com",80 )
+
+If Not tcp Print "Failed.":WaitKey:End
+
+Print "Connected! Sending request..."
+
+WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
+WriteLine tcp,Chr$(10)
+
+If Eof(tcp) Print "Failed.":WaitKey:End
+
+Print "Request sent! Waiting for reply..."
+
+While Not Eof(tcp)
+Print ReadLine$( tcp )
+Wend
+
+If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
+
+CloseTCPStream tcp
+
+WaitKey
+End
+ +

-Print "Connecting..."
-tcp=OpenTCPStream( "www.blitzbasement.com",80 )
+Index

-If Not tcp Print "Failed.":WaitKey:End
-
-Print "Connected! Sending request..."
-
-WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
-WriteLine tcp,Chr$(10)
-
-If Eof(tcp) Print "Failed.":WaitKey:End
-
-Print "Request sent! Waiting for reply..."
-
-While Not Eof(tcp)
- Print ReadLine$( tcp )
-Wend
-
-If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
-
-CloseTCPStream tcp
-
-WaitKey
-End

Index

+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

Index

+ + +Blitz3D Docs + + + +

Cls

+

Parameters

+ + + + +
+None. +
+

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 +
+
+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

Index

+ + +Blitz3D Docs + + + +

ClsColor red,green,blue

+

Parameters

+ + + + +
+red, green and blue = number between 0 and 255 +
+

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 +
+
+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.

Example:

; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+ + +Blitz3D Docs + + + +

Color red,green,blue

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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
-

Index

+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.

Example:

; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+ + +Blitz3D Docs + + + +

ColorBlue()

+

Parameters

+ + + + +
+None. +
+

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. +
+

Example

+ + + + +
+; 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
-

Index

+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.

Example:

; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+ + +Blitz3D Docs + + + +

ColorGreen()

+

Parameters

+ + + + +
+None. +
+

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. +
+

Example

+ + + + +
+; 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
-

Index

+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.

Example:

; Color, ColorRed(), ColorBlue(), ColorGreen() Example
+ + +Blitz3D Docs + + + +

ColorRed()

+

Parameters

+ + + + +
+None. +
+

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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

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

Index

+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.

Example:

+ +
; CONST Example

-Const scrWidth=640
-Const scrHeight=480
-Const alienscore=100
+See also: Global, Local, Dim. +
+

Example

+ + + + +
+; 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 +

-Graphics scrWidth,scrHeight
+Index

-Print "The point value for shooting any alien is always " + alienscore
-

Index

+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.

Example:

; BankSize, ResizeBank, CopyBank Example
+ + +Blitz3D Docs + + + +

CopyBank src_bank,src_offset,dest_bank,dest_offset,count

+

Parameters

+ + + + +
+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 +
+

Description

+ + + + +
+Copies data from one memory bank to another. +
+

Example

+ + + + +
+; 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) +

-; create a bank
-bnkTest=CreateBank(5000)
+Index

-; 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)
-

Index

+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.

Example:

file$="c:\autoexec.bat"
-destination$="a:\autoexec.bat"
+ + +Blitz3D Docs + + + +

CopyFile from$, to$

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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

-WaitKey()
-
-CopyFile file$,destination$
-

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. +
+

Example

+ + + + +
+; 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.

Example:

; CopyImage Example
+Index

-; 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)
-

Index

+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 + + + +

CopyPixel src_x,src_y,src_buffer,dest_x,dest_y,[dest_buffer]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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.

Example:

; CopyPixel/CopyPixelFast commands
+Index

-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
-

Index

+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 + + + +

CopyPixelFast src_x,src_y,src_buffer,dest_x,dest_y,[dest_buffer]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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.

Example:

; CopyPixel/CopyPixelFast commands
+Index

-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
-

Index

+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.

Example:

; CopyRect Example
+ + +Blitz3D Docs + + + +

CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y,[src_buffer],[dest_buffer]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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/CopyStream.htm b/_release/help/commands/2d_commands/CopyStream.htm index 5746a00..6e6a39c 100644 --- a/_release/help/commands/2d_commands/CopyStream.htm +++ b/_release/help/commands/2d_commands/CopyStream.htm @@ -1,42 +1,30 @@ -Command: CopyStream - - +Blitz3D Docs + - - -

  CopyStream  

- -

-Parameters:
-

- - -
-src_stream --
-dest_stream --
-[buffer_size] --
+

CopyStream src_stream,dest_stream[,buffer_size]

+

Parameters

+ + + - +
+src_stream - source stream
+dest_stream - destination stream
+buffer_size (optional) - buffer size of stream
-

Description:
-
- - - - -
CopyStream () ...
-

Example:
-
- - - -
-; Example +

Description

+ + + - +
+Copies a stream.
- +
+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 +
+

Example

+ + + + +
+; 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 +

-See also ASin, Cos, ACos, Tan, Atan, ATan2

Example:

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.
-

Index

+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.

Example:

; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example
+ + +Blitz3D Docs + + + +

CountGFXModes()

+

Parameters

+ + + + +
+None. +
+

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. +
+

Example

+ + + + +
+; 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
+ +

-intModes=CountGfxModes()
+Index

-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

Index

+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. +
+

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!"
-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!"

Index

+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.

Example:

+ +
; Bank Commands Example

-bnkTest=CreateBank(500)
+See also: FreeBank. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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

-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
-
-Freebank bnkTest

Index

+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). +
+

Example

+ + + + +
+; CREATEDIR example
+
+fldr$="c:winntsystem32myfolder"
+createDir fldr$
+Print "Folder created!" +

-fldr$="c:\winnt\system32\myfolder"
-createDir fldr$
-Print "Folder created!"
-

Index

+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.

Example:

; CreateImage/TileImage/ImageBuffer example
+ + +Blitz3D Docs + + + +

CreateImage (width,height[,frames])

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; CreateNetPlayer example
+ + +Blitz3D Docs + + + +

CreateNetPlayer (name$)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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()
-

Index

+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. +
+

Example

+ + + + +
+; 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 ---
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

CreateTimer (frequency)

+

Parameters

+ + + + +
+frequency = usually a framerate like 50 or 60 +
+

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
+ +
+
+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). +
+

Example

+ + + + +
+; Print the current date to the screen
+
+Print "The date is:" + CurrentDate$()
+ +

-Print "The date is:" + CurrentDate$()
-

Index

+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. +
+

Example

+ + + + +
+; CurrentDir$() example
+
+; Print the current directory until ESC key
+While Not KeyHit(1)
+Print CurrentDir$()
+Wend +

-; Print the current directory until ESC key
-While Not KeyHit(1)
-Print CurrentDir$()
-Wend

Index

+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). +
+

Example

+ + + + +
+; Print the current time to the screen
+
+Print "The Time is:" + CurrentTime$()
+ +

-Print "The Time is:" + CurrentTime$()
-

Index

+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. +
+

Example

+ + + + +
+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

-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"
-

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.

Example:

+ +
; DebugLog Example

-; Let's start graphics mode
-Graphics 640,480,16
+See also: Stop. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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(). +
+

Example

+ + + + +
+; Delay for 5 seconds
+
+Delay 5000
+ +

-Delay 5000
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

Delete custom_type_name

+

Parameters

+ + + + +
+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. +
+

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 +
+
+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. +
+

Example

+ + + + +
+; DeleteDir example
+
+DeleteDir "C: est" +

-DeleteDir "C:\test"
-

Index

+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. +
+

Example

+ + + + +
+; DELETEFILE example
+
+DeleteFile "C: estmyfile.bb" +

-DeleteFile "C:\test\myfile.bb"

Index

+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). +
+

Example

+ + + + +
+; 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).

Example:

; DeleteNetPlayer example
+Index

-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()

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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 +
+

Example

+ + + + +
+; 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

Index

+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 + + + +

DrawBlockRect image,x,y,rect_x,rect_y,rect_width,rect_height,[frame]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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.

Example:

; DrawBlockRect Example
+Index

-; 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

Index

+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 +
+

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 +

-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

Index

+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 + + + +

DrawImageRect image,x,y,rect_x,rect_y,rect_width,rect_height,[frame]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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.

Example:

; DrawImageRect Example
+Index

-; 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

Index

+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. +
+

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
+ +

-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
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

Each type_variable

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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. +
+

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!"
+
+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
-

Index

+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
-

Index

+See also: If, Then, ElseIf, EndIf, Select. +
+

Example

+ + + + +
+; 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!"

Else
Print "Sorry, you don't belong here!"

; End of the condition checking
End If

Index

+ + +Blitz3D Docs + + + +

ElseIf

+

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 aSELECT/CASE structure. See the example. +
+
+See also: If, Then, Else, ElseIf, EndIf, Select. +
+

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!"
+
+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

Example

+ + + + +
+; Define the CHAIR Type
+
+Type CHAIR
+Field X
+Field Y
+Field HEIGHT
+End Type
+ +

-After assigning all the Field variables in your Type object, use this to finish the creation of the Type.

Example:

; Define the CHAIR Type
-
- Type CHAIR
- Field X
- Field Y
- Field HEIGHT
- End Type
-

Index

+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
-

Index

+
+See also: Stop. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+Graphics 640,480,0,1
+SetBuffer BackBuffer()
+
+Text 0,0,"EndGraphics Example Stage 1/2"
+Text 0,20,"Currently in Graphics mode"
+Text 0,40,"Press a key to deactive Graphics mode with EndGraphics command"
+
+Flip
+
+WaitKey()
+
+EndGraphics
+
+Print "EndGraphics Example Stage 2/2"
+Print "Currently in non-Graphics mode"
+
+WaitKey()
+
+End +

-; Wait for a left mouse button
-While Not MouseHit(1)
-Wend
+Index

-; End the graphics mode
-EndGraphics
-
-; Print again, this time to the text screen
-For t = 1 To 10
-Print "There"
-Next

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

Example

+ + + + +
+; 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()
-

Index

+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

Index

+
+See also: For, While, Repeat. +
+

Example

+ + + + +
+; 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: Log Log10

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

Index

+ + +Blitz3D Docs + + + +

Exp# ( x# )

+

Parameters

+ + + + +
+x = any number. +
+

Description

+ + + + +
+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() +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; 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 +

-; Let's set test to be false
-test=False
+Index

-; Pointlessly test it
-If test=False Then
-Print "Test is false"
-else
-print "Test is true"
-End If
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

Field variable

+

Parameters

+ + + + +
+variable = any legal variable +
+

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. +
+
+See also: Type, End Type. +
+

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 +
+
+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. +
+

Example

+ + + + +
+; 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

-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
-; 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

Index

+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. +
+

Example

+ + + + +
+; 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

-Print "Press any key to quit."
-
-WaitKey()

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. +
+

Example

+ + + + +
+; 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()

Index

+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

-

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

+ + +Blitz3D Docs + + + +

First type_variable

+

Parameters

+ + + + +
+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. +
+

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
+
+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.

Example:

; Flip/Backbuffer()/Rect Example
+ + +Blitz3D Docs + + + +

Flip [vwait]

+

Parameters

+ + + + +
+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

-; Go double buffering
-SetBuffer BackBuffer()
+See also: FrontBuffer, BackBuffer, VWait, ScanLine. +
+

Example

+ + + + +
+; 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
-

Index

+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 +
+

Example

+ + + + +
+; 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 +

-a=100
-b#=2.5
-c#=Float a
+Index

-Print b# + c#
-
-

Index

+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. +
+

Example

+ + + + +
+; Ceil / Floor / Int example, three kinds of rounding.
+
+; Move mouse. Escape quits.
+
+Graphics 640, 480
+
+Const KEY_ESC = 1
+
+SetBuffer BackBuffer()
+Origin 320, 240
+
+MoveMouse 320, 240 : HidePointer
+
+While Not KeyDown( KEY_ESC )
+
+Cls
+
+my = MouseY() - 240
+Color 100, 100, 0
+Line -320, my, 319, my
+
+DrawNumberLine
+
+y# = Float( -my ) / 32
+
+Text 100, 50, " y = " + y
+Text 100, 70, " Ceil( y ) = " + Ceil( y )
+Text 100, 90, " Floor( y ) = " + Floor( y )
+Text 100, 110, " Int( y ) = " + Int( y )
+
+Flip
+
+Wend
+End
+
+Function DrawNumberLine( ) ; vertical line with numeric labels
+
+Color 255, 255, 255
+Line 0, -240, 0, 239
+
+For n = -7 To 7
+yn = -32 * n
+Line -2, yn, 2, yn
+Text -30, yn - 6, RSet( n, 2 )
+Next
+
+End Function +

-; Set a floating point variable
-myVal#=0.5
+Index

-; Round it up
-Print Floor#(myval)
-
-;Round it down
-Print Ceil#(myval)
-

Index

+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. +
+

Example

+ + + + +
+; FlushJoy sample
+
+FlushJoy
+
+Print "Press a joystick button to exit!"
+
+WaitJoy()
+
+End
+ +

-FlushJoy
+Index

-Print "Press a joystick button to exit!"
-
-WaitJoy()
-
-End

Index

+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
-

Index

+ + +Blitz3D Docs + + + +

FlushKeys

+

Parameters

+ + + + +
+None. +
+

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
+ +
+
+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. +
+

Example

+ + + + +
+; Flushmouse sample
+
+FlushMouse
+
+Print "Press a mouse button to exit!"
+
+WaitMouse()
+
+End
+ +

-FlushMouse
+Index

-Print "Press a mouse button to exit!"
-
-WaitMouse()
-
-End

Index

+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).

Example:

; FontWidth()/FontHeight example
+ + +Blitz3D Docs + + + +

FontHeight()

+

Parameters

+ + + + +
+None. +
+

Description

+ + + + +
+This returns the height, in pixels, of the currently selected font (using SetFont - previously loaded with LoadFont). +
+

Example

+ + + + +
+; 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
+ +

-; enable graphics mode
-Graphics 800,600,16
+Index

-; 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

Index

+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.

Example:

; FontWidth()/FontHeight example
+ + +Blitz3D Docs + + + +

FontWidth()

+

Parameters

+ + + + +
+None. +
+

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. +
+

Example

+ + + + +
+; 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
+ +

-; enable graphics mode
-Graphics 800,600,16
+Index

-; 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

Index

+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
-

Index

+See also: To, Step, Each, Next, Exit, While, Repeat. +
+

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 +
+
+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

-Print "The infinate loop has ended!"
-

Index

+See also: Repeat, Until, Exit, While, For. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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. +
+

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 +

-Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
-

Example:

; LoadFont/SetFont/FreeFont example
+Index

-; 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

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

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
+
+; 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

-; Kill the timer
-FreeTimer(frameTimer)
-

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. +
+

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 +

-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

Index

+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.

-You can pass variables into functions, as well as RETURN boolean values (True/False) back to the calling code.
+See also: End Function, Return, Gosub, Goto. +
+

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 +

-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
-

Index

+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. +
+

Example

+ + +
+; 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
+

-intModes=CountGfxModes()
+Index

-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

Index

+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. +
+

Example

+ + +
+; 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
+

-intModes=CountGfxModes()
+Index

-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

Index

+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. +
+

Example

+ + +
+; 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
+

-intModes=CountGfxModes()
+Index

-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

Index

+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 +
+

Example

+ + + + +
+; GetColor Example
+
+Graphics 320,200
+SetBuffer BackBuffer()
+
+For t = 1 To 1000
+Color Rnd(255), Rnd(255), Rnd(255)
+Rect Rnd(320),Rnd(200),10,10,1
+Next
+
+GetColor 100,100
+Print "Box at 100,100 is RGB:" + ColorRed() + "," + ColorGreen() + "," + ColorBlue() + "!"
+Flip
+While Not KeyHit(1)
+Wend
+ +

-Graphics 320,200
-SetBuffer BackBuffer()
+Index

-For t = 1 To 1000
-Color Rnd(255), Rnd(255), Rnd(255)
-Rect Rnd(320),Rnd(200),10,10,1
-Next
-
-GetColor 100,100
-Print "Box at 100,100 is RGB:" + ColorRed() + "," + ColorGreen() + "," + ColorBlue() + "!"
-Flip
-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/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! +
+

Example

+ + + + +
+; GetJoy Example
+
+While Not KeyHit(1)
+button=GetJoy()
+If button <> 0 Then
+Print "You pressed joystick button #" + button
+End If
+Wend
+ +

-While Not KeyHit(1)
-button=GetJoy()
-If button <> 0 Then
-Print "You pressed joystick button #" + button
-End If
-Wend
-

Index

+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. +
+

Example

+ + +
+; GetKey Example
+
+Print "Please press any ASCII key ..."
+
+While Not value
+value=GetKey()
+Wend
+
+Print "You pressed key with an ASCII value of:" + value
-

Example:

+ +
; GetKey Example
+

-Print "Please press any ASCII key ..."
+Index

-While Not value
-value=GetKey()
-Wend
-
-Print "You pressed key with an ASCII value of:" + value

Index

+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! +
+

Example

+ + + + +
+; GetMouse Example
+
+While Not KeyHit(1)
+button=GetMouse()
+If button <> 0 Then
+Print "You pressed mouse button #" + button
+End If
+Wend
+ +

-While Not KeyHit(1)
-button=GetMouse()
-If button <> 0 Then
-Print "You pressed mouse button #" + button
-End If
-Wend
-

Index

+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. +
+

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!"
+ +

-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!"

Index

+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. +
+

Example

+ + + + +
+; 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

Index

+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

Index

+ + +Blitz3D Docs + + + +

Global variable

+

Parameters

+ + + + +
+variable = any valid variable/TYPE name +
+

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. +
+
+See also: Local, Dim, Const. +
+

Example

+ + + + +
+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

-End
+See also: Return, Goto, Function. +
+

Example

+ + + + +
+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

+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
-

Index

+See also: Gosub, Function. +
+

Example

+ + + + +
+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. +
+

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()
+ +

-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()

Index

+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. +
+

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 +

-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
-

Index

+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.

Example:

; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+ + +Blitz3D Docs + + + +

GraphicsBuffer()

+

Parameters

+ + + + +
+None +
+

Description

+ + + + +
+Use this command to get which buffer Blitz is currently writing to. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+ + +Blitz3D Docs + + + +

GraphicsDepth()

+

Parameters

+ + + + +
+None +
+

Description

+ + + + +
+This command will tell you the color depth of the current graphics mode. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+ + +Blitz3D Docs + + + +

GraphicsHeight()

+

Parameters

+ + + + +
+None +
+

Description

+ + + + +
+This command will tell you the height, in pixels, of the current graphics mode. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; GraphicsWidth(), GraphicsHeight(), GraphicsDepth(), GraphicsBuffer() example
+ + +Blitz3D Docs + + + +

GraphicsWidth()

+

Parameters

+ + + + +
+None +
+

Description

+ + + + +
+This command will tell you the width, in pixels, of the current graphics mode. +
+

Example

+ + + + +
+; 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

Index

+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 +
+

Example

+ + + + +
+;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

Example:

;HandleImage Example
+Index

-Graphics 800,600,16
-
-gfxPlayer=LoadImage("player.bmp")
-HandleImage gfxPlayer,20,20
-DrawImage gfxPlayer,0,0
-WaitKey

Index

+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)

Index

+ + +Blitz3D Docs + + + +

Hex$ (integer)

+

Parameters

+ + + + +
+integer = any valid integer or integer variable +
+

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)
+ +
+
+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.
-

Example (using ShowPointer):
-
- - - -
-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. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; HostNetGame example
+
+joinResults=HostNetGame("ShaneGame")
+
+Select joinResults
+Case 2
+Print "Successfully started host game!"
+Default
+Print "Game was unable to start!"
+End Select
+waitkey()
+ +

-joinResults=HostNetGame("ShaneGame")
+Index

-Select joinResults
- Case 2
- Print "Successfully started host game!"
- Default
- Print "Game was unable to start!"
-End Select
-waitkey()

Index

+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? ")

-; Doesn't the person's name equal SHANE?
-If name$ = "Shane" Then
+See also: Then, Else, ElseIf, EndIf, True, False, Select. +
+

Example

+ + + + +
+; 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
-

Index

+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!

Example:

; CreateImage/TileImage/ImageBuffer example
+ + +Blitz3D Docs + + + +

ImageBuffer (handle[,frame])

+

Parameters

+ + + + +
+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! +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; ImageHeight/ImageWidth Example
+ + +Blitz3D Docs + + + +

ImageHeight (image handle)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

Index

+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 + + + +

ImageRectCollide (image,x,y,frame,rect x,rect y,rect width,rect height)

+

Parameters

+ + + + +
+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. +
+

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
+ +

-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

Index

+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 + + + +

ImageRectOverlap (image,x,y,rect x,rect y,rect width,rect height)

+

Parameters

+ + + + +
+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. +
+

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
+ +

-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

Index

+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.

Example:

; ImageHeight/ImageWidth Example
+ + +Blitz3D Docs + + + +

ImageWidth (image handle)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; MidHandle/ImageXHandle()/ImageYHandle()/AutoMidHandle
+Index

-; 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

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; MidHandle/ImageXHandle()/ImageYHandle()/AutoMidHandle
+Index

-; 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

Index

+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 + + + +

ImagesCollide (image1,x1,y1,frame1,image2,x2,y2,frame2)

+

Parameters

+ + + + +
+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. +
+

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 +

-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

Index

+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. +
+

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
+ +

-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

Index

+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. +
+

Example

+ + + + +
+; 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"
- - -

Index

+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. +
+

Example

+ + + + +
+; Get the user's name and print a welcome
+
+name$=Input$("What is your name?")
+Write "Hello there, " + name$ + "!"
+ +

-name$=Input$("What is your name?")
-Write "Hello there, " + name$ + "!"
-

Index

+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. +
+

Example

+ + + + +
+; 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
-
-

Index

+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 + "!"
-

Index

+ + +Blitz3D Docs + + + +

Instr (string1$, string2$, offset)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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. +
+

Example

+ + + + +
+; Ceil / Floor / Int example, three kinds of rounding.
+
+; Move mouse. Escape quits.
+
+Graphics 640, 480
+
+Const KEY_ESC = 1
+
+SetBuffer BackBuffer()
+Origin 320, 240
+
+MoveMouse 320, 240 : HidePointer
+
+While Not KeyDown( KEY_ESC )
+
+Cls
+
+my = MouseY() - 240
+Color 100, 100, 0
+Line -320, my, 319, my
+
+DrawNumberLine
+
+y# = Float( -my ) / 32
+
+Text 100, 50, " y = " + y
+Text 100, 70, " Ceil( y ) = " + Ceil( y )
+Text 100, 90, " Floor( y ) = " + Floor( y )
+Text 100, 110, " Int( y ) = " + Int( y )
+
+Flip
+
+Wend
+End
+
+Function DrawNumberLine( ) ; vertical line with numeric labels
+
+Color 255, 255, 255
+Line 0, -240, 0, 239
+
+For n = -7 To 7
+yn = -32 * n
+Line -2, yn, 2, yn
+Text -30, yn - 6, RSet( n, 2 )
+Next
+
+End Function +

-myNum#=3.14
-Print "The integer value of " + mynum# + " is: " + Int(myNum#)

Index

+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. +
+

Example

+ + + + +
+; 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()

Index

+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. +
+

Example

+ + + + +
+; 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

+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. +
+

Example

+ + + + +
+; 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

-; Wait 5 seconds
-While MilliSecs() < current+5000
-Wend
-
-; Print the results
-Print "Pressed button " + JoyHit(1) + " times."
-

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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; JoyX()/JoyY() example
+
+While Not KeyHit(1)
+Cls
+Text 0,0,"Joy X Value: " + JoyX() + " - Joy Y Value:" + JoyY()
+Wend
+ +

-While Not KeyHit(1)
-Cls
-Text 0,0,"Joy X Value: " + JoyX() + " - Joy Y Value:" + JoyY()
-Wend

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; JoyXDir() example
+Index

-While Not KeyHit(1)
-Cls
-Text 0,0,"Joy X Direction: " + JoyXDir()
-Wend

Index

+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. +
+

Example

+ + + + +
+; JoyX()/JoyY() example
+
+While Not KeyHit(1)
+Cls
+Text 0,0,"Joy X Value: " + JoyX() + " - Joy Y Value:" + JoyY()
+Wend
+ +

-While Not KeyHit(1)
-Cls
-Text 0,0,"Joy X Value: " + JoyX() + " - Joy Y Value:" + JoyY()
-Wend

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; JoyYDir() example
+Index

-While Not KeyHit(1)
-Cls
-Text 0,0,"Joy Y Direction: " + JoyYDir()
-Wend

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; JoyZ() example
+Index

-While Not KeyHit(1)
-Cls
-Text 0,0,"Joy Z Value: " + JoyZ()
-Wend

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; JoyZDir() example
+Index

-While Not KeyHit(1)
-Cls
-Text 0,0,"Joy Z Direction: " + JoyZDir()
-Wend

Index

+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 +
+

Example

+ + + + +
+; 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

+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. +
+

Example

+ + + + +
+; 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

-; Wait 5 seconds
-While MilliSecs() < current+5000
-Wend
-
-; Print the results
-Print "Pressed ESC " + KeyHit(1) + " times."
-

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) + "'"

Index

+ + +Blitz3D Docs + + + +

LSet$ (string$, length)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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

-

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

+ + +Blitz3D Docs + + + +

Last type_variable

+

Parameters

+ + + + +
+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. +
+

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
+
+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)

Index

+ + +Blitz3D Docs + + + +

Left$ (string$, length)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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!"

Index

+ + +Blitz3D Docs + + + +

Len (string$)

+

Parameters

+ + + + +
+string$ = any valid string variable +
+

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!"
+ +
+
+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. +
+

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

+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. +
+

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 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
-

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; LoadBuffer example
+Index

-; 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

Index

+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 + + + +

LoadFont (fontname$[,height][,bold][,italic][,underlined])

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

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 +

-You will find file handles used all over Blitz. See the example for some well-documented code.

Example:

; LoadImage and DrawImage example
+Index

-; 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

Index

+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. +
+

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
+ +

-; Load the sound file into memory
+Index

-sndPlayerDie=LoadSound("sounds/die.wav")
-
-; Play the sound
-
-PlaySound sndPlayerDie
-

Index

+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. +
+

Example

+ + + + +
+; 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

+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. +
+

Example

+ + + + +
+; Locate example
+
+strName$=Input$("What is your name?")
+
+Locate 100,200
+
+Print "Hello there, " + strName$
+
+While Not KeyHit(1)
+Wend
+ +

-strName$=Input$("What is your name?")
+Index

-Locate 100,200
-
-Print "Hello there, " + strName$
-
-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/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. -

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
+See also: LockedPitch, LockedFormat, LockedPixels, ReadPixelFast, WritePixelFast, UnlockBuffer. +
+

Example

+ + + + +
+; 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 +

-Delay 3000
+Index

-; 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

Index

+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: Exp Log10

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

Index

+ + +Blitz3D Docs + + + +

Log# ( x# )

+

Parameters

+ + + + +
+x = any positive number. +
+

Description

+ + + + +
+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() +
+

Example

+ + + + +
+; 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: Exp Log

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

Index

+ + +Blitz3D Docs + + + +

Log# ( x# )

+

Parameters

+ + + + +
+x = any positive number. +
+

Description

+ + + + +
+Common logarithm of x. This is the inverse of raising 10 to a power.
+
+y = Log10( x ) means y satifies x = 10 ^ y. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + +
+; 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
+

-; Load the sound loop file into memory
+Index

-sndMusicLoop=LoadSound("sounds/loop1.wav")
-
-; Set the sound loop
-
-LoopSound sndMusicLoop
-
-PlaySound sndMusicLoop
-

Index

+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$)
-

Index

+ + +Blitz3D Docs + + + +

Lower$ (string$)

+

Parameters

+ + + + +
+string$ = any valid string variable +
+

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$)
+ +
+
+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. +
+

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 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
-

Index

+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. +
+

Example

+ + + + +
+name$="Shane Monroe"
+For T = 1 To Len(name$)
+Print Mid$(name$,t,1)
+Next +

- -

Index

+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

Index

+ + +Blitz3D Docs + + + +

Millisecs()

+

Parameters

+ + + + +
+None +
+

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
+ +
+
+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. +
+

Example

+ + + + +
+; MOD Example
+
+; Divide 10 by 3 until you reach a point that you can't ; Then print the remaining value - in this case, 1 Print 10 MOD 3
+ +

-; Divide 10 by 3 until you reach a point that you can't -; Then print the remaining value - in this case, 1 -Print 10 MOD 3

Index

+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. +
+

Example

+ + + + +
+; 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

-Print button$ + " mouse button pressed!"
-Wend
-

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.

Example:

; MouseHit Example
+ + +Blitz3D Docs + + + +

MouseHit (button)

+

Parameters

+ + + + +
+button = button code (1=Left, 2=Right, 3-Middle) +
+

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. +
+

Example

+ + + + +
+; 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

-; Wait 5 seconds
-While MilliSecs() < current+5000
-Wend
-
-; Print the results
-Print "Pressed left button " + MouseHit(1) + " times."
-

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. +
+

Example

+ + + + +
+Graphics 640,480
+
+SetBuffer BackBuffer()
+
+Repeat
+Cls
+
+Text 320,0,"Click to reset mouse",True
+
+Text 0,0,"Mouse X:"+MouseX()
+Text 0,10,"Mouse Y:"+MouseY()
+
+If MouseDown(1) Or MouseDown(2) Then MoveMouse 320,240
+
+Text MouseX(),MouseY(),"X",True,True
+
+Flip
+
+Until KeyHit(1)
+
+End +

-; 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
-

Index

+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.

Example:

+ +
; MouseXSpeed()/MouseYSpeed() examples
+See also: MouseYSpeed. +
+

Example

+ + + + +
+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

Index

+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. +
+

Example

+ + + + +
+Graphics 640,480
+
+SetBuffer BackBuffer()
+
+Repeat
+Cls
+
+Text 320,0,"Click to reset mouse",True
+
+Text 0,0,"Mouse X:"+MouseX()
+Text 0,10,"Mouse Y:"+MouseY()
+
+If MouseDown(1) Or MouseDown(2) Then MoveMouse 320,240
+
+Text MouseX(),MouseY(),"X",True,True
+
+Flip
+
+Until KeyHit(1)
+
+End +

-; 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
-

Index

+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.

Example:

+ +
; MouseXSpeed()/MouseYSpeed() examples
+See also: MouseXSpeed. +
+

Example

+ + + + +
+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

Index

+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.
-

Example:
-
- - - -
-Graphics 640, 480, 0, 2
-
-SetBuffer BackBuffer ()
-
-Repeat
-Text 20, 20, "Mouse wheel position: " + MouseZ ()
-Until KeyHit (1)
-
-End
+

MouseZ()

+

Parameters

+ + + - +
+None.
- +

Description

+ + + + +
+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. +
+

Example

+ + + + +
+Graphics 640, 480, 0, 2
+
+SetBuffer BackBuffer ()
+
+Repeat
+Flip:Cls
+Text 20, 20, "Mouse wheel position: " + MouseZ ()
+Until KeyHit (1)
+
+End +
+
+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.
-

Example:
-
- - - -
-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. +
+

Example

+ + + + +
+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
+ +
+
+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. +
+

Example

+ + + + +
+Graphics 640,480
+
+SetBuffer BackBuffer()
+
+Repeat
+Cls
+
+Text 320,0,"Click to reset mouse",True
+
+Text 0,0,"Mouse X:"+MouseX()
+Text 0,10,"Mouse Y:"+MouseY()
+
+If MouseDown(1) Or MouseDown(2) Then MoveMouse 320,240
+
+Text MouseX(),MouseY(),"X",True,True
+
+Flip
+
+Until KeyHit(1)
+
+End +

-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

+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. +
+

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
+ +

-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

Index

+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. +
+

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
+End If
+End If
+Wend
- End If
-End If
-Wend

Index

+
+
+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. +
+

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
+ +

-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

Index

+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.

Example:

+ +
; Define the CHAIR Type

-Type CHAIR
-Field X
-Field Y
-Field HEIGHT
-End Type
+See also: Type, Before, After, First, Last, Each, Insert, Delete. +
+

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 +

-; 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
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

Next

+

Parameters

+ + + + +
+None +
+

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. +
+
+See also: For, To, Step, Each, Exit, While, Repeat. +
+

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 +
+
+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.

Example:

; ReadDir/NextFile$/CloseDir example
+ + +Blitz3D Docs + + + +

NextFile$ (filehandle)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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!"
-

Index

+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
-

Index

+
+See also: And, Or, Xor. +
+

Example

+ + + + +
+; 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"

-Print strHello$
+See also: Type, New, Delete, After, Before, First, Last. +
+

Example

+ + + + +
+; 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!" +

-strHello$=Null

Index

+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. +
+

Example

+ + + + +
+; 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 +

-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 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

Index

+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". +
+

Example

+ + + + +
+; OpenTCPStream/CloseTCPStream Example
+
+Print "Connecting..."
+tcp=OpenTCPStream( "www.blitzbasement.com",80 )
+
+If Not tcp Print "Failed.":WaitKey:End
+
+Print "Connected! Sending request..."
+
+WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
+WriteLine tcp,Chr$(10)
+
+If Eof(tcp) Print "Failed.":WaitKey:End
+
+Print "Request sent! Waiting for reply..."
+
+While Not Eof(tcp)
+Print ReadLine$( tcp )
+Wend
+
+If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
+
+CloseTCPStream tcp
+
+WaitKey
+End
+ +

-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".

Example:

; OpenTCPStream/CloseTCPStream Example
-
-Print "Connecting..."
-tcp=OpenTCPStream( "www.blitzbasement.com",80 )
-
-If Not tcp Print "Failed.":WaitKey:End
-
-Print "Connected! Sending request..."
-
-WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
-WriteLine tcp,Chr$(10)
-
-If Eof(tcp) Print "Failed.":WaitKey:End
-
-Print "Request sent! Waiting for reply..."
-
-While Not Eof(tcp)
- Print ReadLine$( tcp )
-Wend
-
-If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
-
-CloseTCPStream tcp
-
-WaitKey
-End

Index

+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
-

Index

+See also: And, Not, Xor. +
+

Example

+ + + + +
+; 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.

Example:

; Origin example
-Graphics 800,600,16
+ + +Blitz3D Docs + + + +

Origin x,y

+

Parameters

+ + + + +
+x = x offset value
+y = y offset value +
+

Description

+ + + + +
+This command sets a point of origin for all subsequent drawing commands. This can be positive or negative. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; Oval example
-Graphics 800,600,16
+ + +Blitz3D Docs + + + +

Oval x,y,width,height[,solid]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

+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.). +
+

Example

+ + + + +
+; 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

-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

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
-

Command Description:

This command reads a byte type value from a memory bank created with the CreateBank command. Also see PokeInt, PokeFloat, PokeByte, and PokeShort. To retrieve from a memory bank, use PeekInt, PeekFloat, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PeekByte(bank,offset)

+

Parameters

+ + + + +
+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)

-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: PeekShort, PeekInt, PeekFloat. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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
-

Command Description:

This command reads a floating point type value from a memory bank created with the CreateBank command. Also see PokeInt, PokeFloat, PokeByte, and PokeShort. To retrieve from a memory bank, use PeekInt, and PeekByte, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PeekFloat(bank,offset)

+

Parameters

+ + + + +
+bank - bank handle
+offset - offset in bytes, that the peek operation will be started at +
+

Description

+ + + + +
+Reads a float from a memory bank and returns the value.
+
+A float takes up four bytes of a memory 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: PeekByte, PeekShort, PeekInt. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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
-

Command Description:

This command reads an integer type value from a memory bank created with the CreateBank command. Also see PokeInt, PokeFloat, PokeByte, and PokeShort. To retrieve from a memory bank, use PeekFloat, and PeekByte, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PeekInt(bank,offset)

+

Parameters

+ + + + +
+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)

-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: PeekByte, PeekShort, PeekFloat. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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
-

Command Description:

This command reads a short type value from a memory bank created with the CreateBank command. Also see PokeInt, PokeFloat, PokeByte, and PokeShort. To retrieve from a memory bank, use PeekInt, PeekFloat, and PeekByte.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PeekShort(bank,offset)

+

Parameters

+ + + + +
+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)

-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: PeekByte, PeekInt, PeekFloat. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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. +
+

Example

+ + + + +
+; Pi example
+
+Print "The Value of Pi is:" + Pi
+ +

-Print "The Value of Pi is:" + Pi
-

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; PlayCDTrack example
+Index

-; 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

Index

+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. +
+

Example

+ + + + +
+; Load and play the background music
+
+chnBackground=PlayMusic("music\background.wav") +

-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.
+Index

-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")
-

Index

+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. +
+

Example

+ + + + +
+; 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 ) +

-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.

Example:

; Assign a global variable for the sound
-Global sndPlayerDie
+Index

-; Load the sound file into memory
-
-sndPlayerDie=LoadSound("sounds/die.wav")
-
-; Play the sound
-
-chnDie=PlaySound sndPlayerDie
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

Plot x,y

+

Parameters

+ + + + +
+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 +
+

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 +
+
+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

Command Description:

This command writes a byte type value into a memory bank created with the CreateBank command. Also see PokeInt, PokeFloat, and PokeShort. To retrieve from a memory bank, use PeekInt, PeekFloat, PeekByte, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PokeByte bank,offset,value

+

Parameters

+ + + + +
+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 a byte into a memory bank.
+
+A byte takes up one byte of a memory bank. Values can be in the range 0 to 255.
-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: PokeShort, PokeInt, PokeFloat. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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

Command Description:

This command writes a floating point type value into a memory bank created with the CreateBank command. Also see PokeInt, PokeByte, and PokeShort. To retrieve from a memory bank, use PeekInt, PeekFloat, PeekByte, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PokeFloat bank,offset,value

+

Parameters

+ + + + +
+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 a float into a memory bank.
+
+A float takes up four bytes of a memory 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: PokeByte, PokeShort, PokeInt. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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

Command Description:

This command writes a integer type value into a memory bank created with the CreateBank command. Also see PokeFloat, PokeByte, and PokeShort. To retrieve from a memory bank, use PeekInt, PeekFloat, PeekByte, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PokeInt bank,offset,value

+

Parameters

+ + + + +
+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)

-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: PokeByte, PokeShort, PokeFloat. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Pint PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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

Command Description:

This command writes a short type value into a memory bank created with the CreateBank command. Also see PokeInt, PokeFloat, and PokeByte. To retrieve from a memory bank, use PeekInt, PeekFloat, PeekByte, and PeekShort.

Example:

; Bank Commands Example
+ + +Blitz3D Docs + + + +

PokeShort bank,offset,value

+

Parameters

+ + + + +
+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 a short into a memory bank.
+
+A short takes up two bytes of a memory bank. Values can be in the range 0 to 65535.
-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: PokeByte, PokeInt, PokeFloat. +
+

Example

+ + + + +
+; Bank Commands Example
+; ---------------------
+
+bnkTest=CreateBank(12)
+
+PokeByte bnkTest,0,Rand(255)
+PokeShort bnkTest,1,Rand(65535)
+PokeInt bnkTest,3,Rand(-2147483648,2147483647)
+PokeFloat bnkTest,7,0.5
+
+Print PeekByte(bnkTest,0)
+Print PeekShort(bnkTest,1)
+Print PeekInt(bnkTest,3)
+Print PeekFloat(bnkTest,7)
+
+FreeBank bnkTest +

-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
+Index

-Freebank bnkTest

Index

+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. +
+

Example

+ + + + +
+; Print Example
+; -------------
+
+Print "Blitz "
+Print "Basic"
+ +

-name$=Input$("What is your name?")
-Print "Hello there, " + name$ + "!"
-

Index

+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) + "'"

Index

+ + +Blitz3D Docs + + + +

RSet$ (string$, length)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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. +
+

Example

+ + + + +
+; 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.

Example:

; Rand example
+Index

-; 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

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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'. -

Example:

; OpenTCPStream/CloseTCPStream/ReadAvail Example
+ + +Blitz3D Docs + + + +

ReadAvail (filehandle/streamhandle)

+

Parameters

+ + + + +
+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'. +
+

Example

+ + + + +
+; OpenTCPStream/CloseTCPStream/ReadAvail Example
+
+Print "Connecting..."
+tcp=OpenTCPStream( "www.blitzbasement.com",80 )
+
+If Not tcp Print "Failed.":WaitKey:End
+
+Print "Connected! Sending request..."
+
+WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
+WriteLine tcp,Chr$(10)
+
+If Eof(tcp) Print "Failed.":WaitKey:End
+
+Print "Request sent! Waiting for reply..."
+
+While Not Eof(tcp)
+Print ReadLine$( tcp )
+Print "Bytes available:" + ReadAvail(tcp)
+Wend
+
+If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
+
+CloseTCPStream tcp
+
+WaitKey
+ +

-Print "Connecting..."
-tcp=OpenTCPStream( "www.blitzbasement.com",80 )
+Index

-If Not tcp Print "Failed.":WaitKey:End
-
-Print "Connected! Sending request..."
-
-WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
-WriteLine tcp,Chr$(10)
-
-If Eof(tcp) Print "Failed.":WaitKey:End
-
-Print "Request sent! Waiting for reply..."
-
-While Not Eof(tcp)
- Print ReadLine$( tcp )
- Print "Bytes available:" + ReadAvail(tcp)
-Wend
-
-If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
-
-CloseTCPStream tcp
-
-WaitKey

Index

+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
+
+

Example

+ + + + +
+; 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

-; 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()

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. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; ReadDir/NextFile$/CloseDir example
+ + +Blitz3D Docs + + + +

ReadDir (directory)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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!"
-

Index

+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. +
+

Example

+ + + + +
+; Reading and writing custom types to files using ReadFile, WriteFile and CloseFile
+
+; Initialise some variables for the example
+Type HighScore
+Field Name$
+Field Score%
+Field Level%
+End Type
+
+Best.HighScore = New HighScore
+BestName = "Mark"
+BestScore = 11657
+BestLevel = 34
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteString( fileout, BestName )
+WriteInt( fileout, BestScore )
+WriteByte( fileout, BestLevel )
+
+; 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
+GreatestName$ = ReadString$( filein )
+GreatestScore = ReadInt( filein )
+GreatestLevel = ReadByte( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "High score record read from - mydata.dat "
+Print
+Write "Name = "
+Print GreatestName
+Write "Score = "
+Print GreatestScore
+Write "Level = "
+Print GreatestLevel
+
+WaitKey() +

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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()
+ +

+Index

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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

-ReadLine$ returns all chars except chr$(13)/chr$(10).
-
-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; 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

-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 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()

Index

+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.

-Streams can only be used in Blitz Basic v1.52 or greater.
+See also: WriteString, OpenTCPStream, ReadFile, ReadLine, ReadByte, ReadShort, ReadInt, ReadFloat, ReadBytes, ReadAvail. +
+

Example

+ + + + +
+; 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() +

-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 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()

Index

+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'.

Example:

; Flip/Backbuffer()/Rect Example
+ + +Blitz3D Docs + + + +

Rect x, y, width, height, solid

+

Parameters

+ + + + +
+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'. +
+

Example

+ + + + +
+; 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
+ +

-; Set Graphics Mode
-Graphics 640,480
+Index

-; 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
-

Index

+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 + + + +

RectsOverlap (rect1 X,rect1 Y,rect1 Width,rect1 Height,rect2 X,rect2 Y,rect2 Width,rect2 Height)

+

Parameters

+ + + + +
+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. +
+

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
+ +

-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

Index

+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. +
+

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
+ +

-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

Index

+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)
-

Index

+
+See also: Until, Forever, Exit, While, For. +
+

Example

+ + + + +
+; 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")
-

Index

+ + +Blitz3D Docs + + + +

Replace$ (string$, find$, replace$)

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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.

Example:

; BankSize, ResizeBank, CopyBank Example
+ + +Blitz3D Docs + + + +

ResizeBank bankhandle,new_size

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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)
+ +

-; create a bank
-bnkTest=CreateBank(5000)
+Index

-; 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)
-

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; ResizeImage example
+Index

-; 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

Index

+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.

Example:

; Sample of read/restore/data/label commands
+ + +Blitz3D Docs + + + +

Restore label

+

Parameters

+ + + + +
+label = any valid and exisiting label +
+

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.
-; 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. +
+

Example

+ + + + +
+; 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
-

Index

+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).
-

Example (using ResumeChannel):
-
- - - -
-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). +
+

Example

+ + + + +
+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. +
+

Example

+ + + + +
+; 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
-

Index

+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)
-

Index

+ + +Blitz3D Docs + + + +

Right$ (string$, length)

+

Parameters

+ + + + +
+string$ = any valid string variable
+length = the number of characters on the right to return +
+

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)
+ +
+
+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

Index

+ + +Blitz3D Docs + + + +

Rnd (start#,end#)

+

Parameters

+ + + + +
+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. +
+

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 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! +
+

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 +

-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

Index

+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. +
+

Example

+ + + + +
+;There was a problem - raise an error and quit
+
+RuntimeError "Installation corrupted. Please reinstall." +

-RuntimeError "Installation corrupted. Please reinstall."
-

Index

+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.

Example:

+ +
; shl, shr, sar examples
+See also: Shl, Shr. +
+

Example

+ + + + +
+; 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() +

-value = 100
+Index

-; 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()

Index

+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. +
+

Example

+ + + + +
+; Save the screen when player pushes F10
+
+If KeyHit(10) Then
+SaveBuffer(FrontBuffer(),"screenshot.bmp")
+End If
+ +

-If KeyHit(10) Then
-SaveBuffer(FrontBuffer(),"screenshot.bmp")
-End If
-

Index

+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. +
+

Example

+ + + + +
+; 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 +

-; Set Graphics Mode
-Graphics 800,600,16
+Index

-; 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

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; ScaleImage example
+Index

-; 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

Index

+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
-

Index

+
+See also: VWait, Flip. +
+

Example

+ + + + +
+; 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.

Index

+ + +Blitz3D Docs + + + +

SeedRnd seed

+

Parameters

+ + + + +
+seed = valid integer number +
+

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. +
+
+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. +
+

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 +

-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

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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. +
+

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
+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

Index

+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

Index

+ + +Blitz3D Docs + + + +

SetBuffer buffer

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+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. +
+

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
+ +

-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

Index

+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. +
+

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!"
+ +

-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!"

Index

+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

Index

+ + +Blitz3D Docs + + + +

Sgn (number)

+

Parameters

+ + + + +
+number=float or integer +
+

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
+ +
+
+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. +
+

Example

+ + + + +
+; 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.

Example:

; shl, shr, sar examples
+Index

-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()

Index

+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.
-

Example:
-
- - - -
-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. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; 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.

Example:

; shl, shr, sar examples
+Index

-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()

Index

+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 +
+

Example

+ + + + +
+; 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 +

-See also ASin, Cos, ACos, Tan, Atan, ATan2

Example:

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.
-

Index

+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.

Example:

; Load sound sample
-sndDeath=LoadSound("audio\death.wav")
+ + +Blitz3D Docs + + + +

SoundPan sound_variable,pan#

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

-; Play sound
-PlaySound sndDeath
-

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. +
+

Example

+ + + + +
+; 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.

Example:

; Load the sound (11,000 hertz)
+Index

-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
-

Index

+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! +
+

Example

+ + + + +
+; Load sound sample
+sndDeath=LoadSound("audiodeath.wav")
+
+; Change volume level to half
+SoundVolume sndDeath,.5
+
+; Play sound
+PlaySound sndDeath
+ +

-Please see ChannelVolume for more options!

Example:

; Load sound sample
-sndDeath=LoadSound("audio\death.wav")
+Index

-; Change volume level to half
-SoundVolume sndDeath,.5
-
-; Play sound
-PlaySound sndDeath
-

Index

+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. +
+

Example

+ + + + +
+; sqr# example
+
+value=25
+
+print "The square root of our value is: " + sqr#(value)
+waitkey()
+ +

-value=25
+Index

-print "The square root of our value is: " + sqr#(value)
-waitkey()

Index

+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. +
+

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
+ +

-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

Index

+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.

Example:

; Print 1 through 100, by tens

For t = 1 To 100 Step 10
Print t
Next

Index

+ + +Blitz3D Docs + + + +

Step

+

Parameters

+ + + + +
+None. +
+

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. +
+
+See also: For, To, Each, Next, Exit, While, Repeat. +
+

Example

+ + + + +
+; 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

Index

+
+See also: DebugLog, End. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; 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.

Example:

; Channel examples
+Index

-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

Index

+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. +
+

Example

+ + + + +
+; 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

+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. +
+

Example

+ + + + +
+; STR example
+
+num#=2.5
+mynum$=str num#
+
+Print mynum$ +

-num#=2.5
-mynum$=str num#
+Index

-Print mynum$
-
-

Index

+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)
-

Index

+ + +Blitz3D Docs + + + +

String$ (string$, integer)

+

Parameters

+ + + + +
+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. +
+

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.

Example:

; StringWidth/Height Example
+ + +Blitz3D Docs + + + +

StringHeight (string)

+

Parameters

+ + + + +
+string = any valid string or string variable +
+

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. +
+

Example

+ + + + +
+; StringWidth/Height Example
+
+a$="Hello Shane!"
+Print "A$=" + a$
+Print "This string is "+ StringWidth(a$) + " pixels wide and"
+Print "it is " + StringHeight(a$) + " tall, based on the current font!"
+ +

-a$="Hello Shane!"
-Print "A$=" + a$
-Print "This string is "+ StringWidth(a$) + " pixels wide and"
-Print "it is " + StringHeight(a$) + " tall, based on the current font!"
-

Index

+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.

Example:

; StringWidth/Height Example
+ + +Blitz3D Docs + + + +

StringWidth (string)

+

Parameters

+ + + + +
+string = any valid string or string variable +
+

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. +
+

Example

+ + + + +
+; StringWidth/Height Example
+
+a$="Hello Shane!"
+Print "A$=" + a$
+Print "This string is "+ StringWidth(a$) + " pixels wide and"
+Print "it is " + StringHeight(a$) + " tall, based on the current font!"
+ +

-a$="Hello Shane!"
-Print "A$=" + a$
-Print "This string is "+ StringWidth(a$) + " pixels wide and"
-Print "it is " + StringHeight(a$) + " tall, based on the current font!"
-

Index

+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)
-

Example:
-
- - - -
-Print "System folder location: " + SystemProperty ("systemdir")
-Print "Windows folder location: " + SystemProperty ("windowsdir")
-Print "Temp folder: " + SystemProperty ("tempdir")
-Print "Program was run from " + SystemProperty ("appdir")
+

Description

+ + + - +
+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
- +

Example

+ + + + +
+Print "System folder location: " + SystemProperty ("systemdir")
+Print "Windows folder location: " + SystemProperty ("windowsdir")
+Print "Temp folder: " + SystemProperty ("tempdir")
+Print "Program was run from " + SystemProperty ("appdir") +
+
+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. +
+

Example

+ + +
+None.
-

  TCPTimeOuts  

- -

-Parameters:
-

- - - - +
-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). -
-

Example:
-
- - - - - -
-; 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. +
+

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
+ +

-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

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; tan example
+Index

-angle1=25
-angle2=45
-
-print "The ratio of angle 1 is: " + tan(angle1)
-print "The ratio of angle 2 is: " + tan(angle2)
-waitkey()

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; Text example
+Index

-; 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

Index

+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. +
+

Example

+ + + + +
+; 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
-

Index

+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.

Example:

; TileBlock example
-Graphics 800,600,16
+ + +Blitz3D Docs + + + +

TileBlock image [,x,y,frame]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; CreateImage/TileImage/ImageBuffer example
+ + +Blitz3D Docs + + + +

TileImage handle,[x],[y],[frames]

+

Parameters

+ + + + +
+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. +
+

Example

+ + + + +
+; 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

Index

+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.

Example:

; Print numbers 10 to 1

For t = 10 to 1 Step -1
Print t
Next

Index

+ + +Blitz3D Docs + + + +

To

+

Parameters

+ + + + +
+See example +
+

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. +
+
+See also: For, To, Step, Each, Next, Exit, While, Repeat. +
+

Example

+ + + + +
+; 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 (). +

TotalVidMem()

+

Parameters

+ + + - +
+None.
-

Example:
-
- - - - - +

Description

+
-Print "Total graphics memory available: " + TotalVidMem () + " bytes."
-; NOTE: To retrieve the *available* graphics memory, use AvailVidMem ()!
+ + +
+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 (). +
- +

Example

+ + + + +
+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

+ + +Blitz3D Docs + + + +

Trim$( string$ )

+

Parameters

+ + + + +
+string$ - any valid string +
+

Description

+ + + + +
+This function removes leading and trailing spaces from the specified string. +
+

Example

+ + + + +
+Graphics 640,480,0,2
+
+a$ = " Weeeeee "
+
+Text 0,0,a$
+Text 0,20,Trim$(a$)
+
+WaitKey() +
+
+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. +
+

Example

+ + + + +
+; 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 +

-; Let's set test to be true
-test=True
+Index

-; Pointlessly test it
-If test=True Then
-Print "Test is true"
-End If
-

Index

+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

Index

+ + +Blitz3D Docs + + + +

Type variable

+

Parameters

+ + + + +
+variable = any legal variable name +
+

Description

+ + + + +
+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. +
+

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 +
+
+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.

-See the other commands for more information.

Example:

+ +
; High Speed Graphics Commands
+See also: LockedPitch, LockedFormat, LockedPixels, ReadPixelFast, WritePixelFast, LockBuffer. +
+

Example

+ + + + +
+; 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 +

-Graphics 640,480,16
+Index

-; 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

Index

+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)
-

Index

+
+See also: Repeat, Forever, Exit, While, For. +
+

Example

+ + + + +
+; 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$)
-

Index

+ + +Blitz3D Docs + + + +

Upper$ (string$)

+

Parameters

+ + + + +
+string$ = any valid string or string variable +
+

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$)
+ +
+
+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.

Example:

+ +
; Vwait example
-Graphics 800,600,16
+ + +Blitz3D Docs + + + +

VWait [frames]

+

Parameters

+ + + + +
+[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
-

Index

+
+See also: Flip, ScanLine. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; 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 Graphics Mode
-Graphics 800,600
+Index

-; 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
-

Index

+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. +
+

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
+ +

-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
-

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; WaitKey() sample
+Index

-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
-

Index

+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. +
+

Example

+ + + + +
+; 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.

Example:

; WaitMouse() sample
+Index

-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
-

Index

+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. +
+

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 +

-; 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

+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

Index

+
+See also: While, Exit, Repeat, For. +
+

Example

+ + + + +
+; 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

Index

+
+See also: Wend, Exit, Repeat, For. +
+

Example

+ + + + +
+; 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. +
+

Example

+ + + + +
+; Write Example
+; -------------
+
+Write "Blitz "
+Write "Basic"
+ +

-name$=Input$("What is your name?")
-Write "Hello there, " + name$ + "!"
-

Index

+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. +
+

Example

+ + + + +
+; 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()
+ +

-Advanced notes:
+Index

-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
-
-; 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()

Index

+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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; Reading and writing custom types to files using ReadFile, WriteFile and CloseFile
+
+; Initialise some variables for the example
+Type HighScore
+Field Name$
+Field Score%
+Field Level%
+End Type
+
+Best.HighScore = New HighScore
+BestName = "Mark"
+BestScore = 11657
+BestLevel = 34
+
+; Open a file to write to
+fileout = WriteFile("mydata.dat")
+
+; Write the information to the file
+WriteString( fileout, BestName )
+WriteInt( fileout, BestScore )
+WriteByte( fileout, BestLevel )
+
+; 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
+GreatestName$ = ReadString$( filein )
+GreatestScore = ReadInt( filein )
+GreatestLevel = ReadByte( filein )
+
+; Close the file once reading is finished
+CloseFile( filein )
+
+Print "High score record read from - mydata.dat "
+Print
+Write "Name = "
+Print GreatestName
+Write "Score = "
+Print GreatestScore
+Write "Level = "
+Print GreatestLevel
+
+WaitKey() +

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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

-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 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()

Index

+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. +
+

Example

+ + + + +
+; 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

-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 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()

Index

+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.

Example:

+ +
; High Speed Graphics Commands

-Graphics 640,480,16
+See also: Plot, WritePixelFast, LockBuffer. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; 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

Index

+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. +
+

Example

+ + + + +
+; 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.

-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 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()
-

Index

+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. +
+

Example

+ + + + +
+; 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

-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 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()

Index

+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. +
+

Example

+ + + + +
+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.
-

Index

+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:
-

- - - - +

AddAnimSeq ( entity,length)

+

Parameters

+
entity - entity handle
- length -
+ + +
+entity - entity handle
+length - +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+;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

- +
+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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+mesh = CreateMesh()
+surf = CreateSurface(mesh)
+
+v0 = AddVertex (surf, -5,-5,0, 0 ,0)
+v1 = AddVertex (surf, 5,-5,0, 1 ,0)
+v2 = AddVertex (surf, 0, 5,0, 0.5,1)
+
+tri = AddTriangle (surf,v0,v2,v1)
+
+cam = CreateCamera()
+MoveEntity cam, 0,0,-7
+
+RenderWorld
+Flip
+
+WaitKey
+End +
-

Index

- - \ 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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

-
+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+mesh = CreateMesh()
+surf = CreateSurface(mesh)
+
+v0 = AddVertex (surf, -5,-5,0, 0 ,0)
+v1 = AddVertex (surf, 5,-5,0, 1 ,0)
+v2 = AddVertex (surf, 0, 5,0, 0.5,1)
+
+tri = AddTriangle (surf,v0,v2,v1)
+
+cam = CreateCamera()
+MoveEntity cam, 0,0,-7
+
+RenderWorld
+Flip
+
+WaitKey
+End +
-

Index

- - \ 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 + - - -

  AlignToVector entity,vector_x#,vector_y#,vector_z#,axis  

- -

-Parameters:
-

- - - - +

AlignToVector entity,vector_x#,vector_y#,vector_z#,axis[,rate#]

+

Parameters

+
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
+ + +
+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. +
-

Description:
-
- - - - +

Description

+
Aligns an entity axis to a vector.
+ + +
+Aligns an entity axis to a vector. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

AmbientLight red#,green#,blue#

+

Parameters

+
red# - red ambient light value
-green# - green ambient light value
-blue# - blue ambient light value
+ + +
+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

+ + + - +See also: CreateLight. + +
+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.
-

Example:
-
- - - - - +

Example

+
; AmbientLight Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- sphere=CreateSphere( 32 )
- PositionEntity sphere,-2,0,5
-
- cone=CreateCone( 32 )
- PositionEntity cone,2,0,5
-
- ; Set initial ambient light colour values
- red#=127
- green#=127
- blue#=127
-
- 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 ambient light using red, green, blue values
- AmbientLight red#,green#,blue#
-
- RenderWorld
-
- Text 0,0,"Press keys 1-6 to change AmbientLight red#,green#,blue# values
- Text 0,20,"Ambient Red: "+red#
- Text 0,40,"Ambient Green: "+green#
- Text 0,60,"Ambient Blue: "+blue#
-
- Flip
-
- Wend
-
- End
+ + +
+; AmbientLight Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+sphere=CreateSphere( 32 )
+PositionEntity sphere,-2,0,5
+
+cone=CreateCone( 32 )
+PositionEntity cone,2,0,5
+
+; Set initial ambient light colour values
+red#=127
+green#=127
+blue#=127
+
+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 ambient light color using red, green, blue values
+AmbientLight red#,green#,blue#
+
+RenderWorld
+
+Text 0,0,"Press keys 1-6 to change AmbientLight red#,green#,blue# values
+Text 0,20,"Ambient Red: "+red#
+Text 0,40,"Ambient Green: "+green#
+Text 0,60,"Ambient Blue: "+blue#
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/AnimLength.htm b/_release/help/commands/3d_commands/AnimLength.htm index 4faf61a..599a146 100644 --- a/_release/help/commands/3d_commands/AnimLength.htm +++ b/_release/help/commands/3d_commands/AnimLength.htm @@ -1,37 +1,28 @@ -Command: AnimLength - - +Blitz3D Docs + - - -

  AnimLength ( entity )  

- -

-Parameters:
-

- - - - +

AnimLength ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns the length of the specified entity's current animation sequence.
+ + +
+Returns the length of the specified entity's current animation sequence. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/AnimSeq.htm b/_release/help/commands/3d_commands/AnimSeq.htm index 96f0f3c..b99fbe2 100644 --- a/_release/help/commands/3d_commands/AnimSeq.htm +++ b/_release/help/commands/3d_commands/AnimSeq.htm @@ -1,37 +1,28 @@ -Command: AnimSeq - - +Blitz3D Docs + - - -

  AnimSeq ( entity )  

- -

-Parameters:
-

- - - - +

AnimSeq ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns the specified entity's current animation sequence.
+ + +
+Returns the specified entity's current animation sequence. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/AnimTime.htm b/_release/help/commands/3d_commands/AnimTime.htm index 0e244a8..bc5eebe 100644 --- a/_release/help/commands/3d_commands/AnimTime.htm +++ b/_release/help/commands/3d_commands/AnimTime.htm @@ -1,37 +1,28 @@ -Command: AnimTime - - +Blitz3D Docs + - - -

  AnimTime# ( entity )  

- -

-Parameters:
-

- - - - +

AnimTime# ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns the current animation time of an entity.
+ + +
+Returns the current animation time of an entity. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/Animate.htm b/_release/help/commands/3d_commands/Animate.htm index f9b67a4..6a7b042 100644 --- a/_release/help/commands/3d_commands/Animate.htm +++ b/_release/help/commands/3d_commands/Animate.htm @@ -1,57 +1,46 @@ -Command: Animate - - +Blitz3D Docs + - - -

  Animate entity,[,mode][,speed#][,sequence][,transition#]  

- -

-Parameters:
-

- - - - +

Animate entity[,mode][,speed#][,sequence][,transition#]

+

Parameters

+
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:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/AnimateMD2.htm b/_release/help/commands/3d_commands/AnimateMD2.htm index a049894..26630a9 100644 --- a/_release/help/commands/3d_commands/AnimateMD2.htm +++ b/_release/help/commands/3d_commands/AnimateMD2.htm @@ -1,84 +1,81 @@ -Command: AnimateMD2 - - +Blitz3D Docs + - - -

  AnimateMD2 md2[,mode][,speed#][,first_frame][,last_frame]  

- -

-Parameters:
-

- - - - +

AnimateMD2 md2[,mode][,speed#][,first_frame][,last_frame][,transition#]

+

Parameters

+
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.

+ + +
+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:
-
- - - - +

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.

-

See also: LoadMD2, - MD2AnimTime, - MD2AnimLength, MD2Animating, - UpdateWorld.

+ + +
+Animates an md2 entity.
+
+The md2 will actually move from one frame to the next when UpdateWorld is called. +
-

Example:
-
- - - - - +

Example

+
; AnimateMD2 Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load md2
- gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" )
-
- ; Load md2 texture
- garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
-
- ; Apply md2 texture to md2
- EntityTexture gargoyle,garg_tex
-
- ; Animate md2
- AnimateMD2 gargoyle,1,0.1,32,46
-
- PositionEntity gargoyle,0,-45,100
- RotateEntity gargoyle,0,180,0
-
- While Not KeyDown( 1 )
- UpdateWorld
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; AnimateMD2 Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load md2
+gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" )
+
+; Load md2 texture
+garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
+
+; Apply md2 texture to md2
+EntityTexture gargoyle,garg_tex
+
+; Animate md2
+AnimateMD2 gargoyle,1,0.1,32,46
+
+PositionEntity gargoyle,0,-45,100
+RotateEntity gargoyle,0,180,0
+
+While Not KeyDown( 1 )
+UpdateWorld
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/Animating.htm b/_release/help/commands/3d_commands/Animating.htm index 9792359..f51ab52 100644 --- a/_release/help/commands/3d_commands/Animating.htm +++ b/_release/help/commands/3d_commands/Animating.htm @@ -1,37 +1,28 @@ -Command: Animating - - +Blitz3D Docs + - - -

  Animating ( entity )  

- -

-Parameters:
-

- - - - +

Animating ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns true if the specified entity is currently animating.
+ + +
+Returns true if the specified entity is currently animating. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

AntiAlias

+

Parameters

+
enable - true to enable fullscreen antialiasing, false to disable. Defaults -to false.
+ + + +
+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. +
+

Example

+ + + +
+; 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.
-

Example:
-
- - - - - -
; 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=False Then Text 0,20,"AntiAlias False" Else Text 0,20,"AntiAlias - True"
-
- Flip
-
- Wend
-
- End
-

Index

- +Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/BrushAlpha.htm b/_release/help/commands/3d_commands/BrushAlpha.htm index 480bdfd..5d68609 100644 --- a/_release/help/commands/3d_commands/BrushAlpha.htm +++ b/_release/help/commands/3d_commands/BrushAlpha.htm @@ -1,49 +1,35 @@ -Command: BrushAlpha - - +Blitz3D Docs + - - -

  BrushAlpha brush,alpha#  

- -

-Parameters:
-

- - - - +

BrushAlpha brush,alpha#

+

Parameters

+
brush - brush handle
- alpha# - alpha level of brush
+ + +
+brush - brush handle
+alpha# - alpha level of brush +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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 + - - -

  BrushBlend brush,blend  

- -

-Parameters:
-

- - - - +

BrushBlend brush,blend

+

Parameters

+
brush - brush handle
- blend -
- 1: alpha
- 2: multiply (default)
- 3: add
+ + +
+brush - brush handle
+blend -
+1: alpha (default)
+2: multiply
+3: add +
-

Description:
-
- - - - +

Description

+
Sets the blending mode for a brush.
+ + +
+Sets the blending mode for a brush. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

BrushColor brush,red#,green#,blue#

+

Parameters

+
brush - brush handle
- red# - brush red value
- green# - brush green value
- blue# - brush blue value
+ + +
+brush - brush handle
+red# - red value of brush
+green# - green value of brush
+blue# - blue value of brush +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; BrushColor Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Create brush
- brush=CreateBrush()
-
- ; Set brush color
- BrushColor brush,0,0,255
-
- ; Paint mesh with brush
- PaintMesh cube,brush
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; BrushColor Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Create brush
+brush=CreateBrush()
+
+; Set brush color
+BrushColor brush,0,0,255
+
+; Paint mesh with brush
+PaintMesh cube,brush
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+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:
-

- - - - +

BrushFX brush,fx

+

Parameters

+
brush - brush handle
-
- fx -
- 1: full-bright
- 2: use vertex colors instead of brush color
- 4: flatshaded
- 8: disable fog
+ + +
+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:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - -
<example>
-

Index

- +
+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:
-

- - - - +

BrushShininess brush,shininess#

+

Parameters

+
brush - brush handle
- shininess# - shininess of brush
+ + +
+brush - brush handle
+shininess# - shininess of brush +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

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.
+ + +
+brush - brush handle
+texture - texture handle
+frame (optional) - texture frame. Defaults to 0.
+index (optional) - texture index. Defaults to 0. +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateBrush Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture( "media/b3dlogo.jpg" )
-
- ; Create brush
- brush=CreateBrush()
-
- ; Apply texture to brush
- BrushTexture brush,tex
-
- ; Paint mesh with brush
- PaintMesh cube,brush
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; BrushTexture Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Create brush
+brush=CreateBrush()
+
+; Apply texture to brush
+BrushTexture brush,tex
+
+; Paint mesh with brush
+PaintMesh cube,brush
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

Description

+
Sets camera background color. Defaults to 0,0,0.
+ + +
+Sets camera background color. Defaults to 0,0,0. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; CameraClsColor Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+sphere=CreateSphere( 32 )
+PositionEntity sphere,0,0,5
+
+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 clear color using red, green, blue values
+CameraClsColor camera,red#,green#,blue#
+
+RenderWorld
+
+Text 0,0,"Press keys 1-6 to change CameraClsColor red#,green#,blue# values
+Text 0,20,"Red: "+red#
+Text 0,40,"Green: "+green#
+Text 0,60,"Blue: "+blue#
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CameraClsMode.htm b/_release/help/commands/3d_commands/CameraClsMode.htm index d99cb8f..8c0545b 100644 --- a/_release/help/commands/3d_commands/CameraClsMode.htm +++ b/_release/help/commands/3d_commands/CameraClsMode.htm @@ -1,39 +1,89 @@ -Command: CameraClsMode - - +Blitz3D Docs + - - -

  CameraClsMode camera,cls_color,cls_zbuffer  

- -

-Parameters:
-

- - - - +

CameraClsMode camera,cls_color,cls_zbuffer

+

Parameters

+
camera - camera handle
- cls_color - true to clear the color buffer, false not to
- cls_zbuffer - true to clear the z-buffer, false not to
+ + +
+camera - camera handle
+cls_color - true to clear the color buffer, false not to
+cls_zbuffer - true to clear the z-buffer, false not to +
-

Description:
-
- - - - +

Description

+
Sets camera clear mode.
+ + +
+Sets camera clear mode. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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 +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CameraFogColor.htm b/_release/help/commands/3d_commands/CameraFogColor.htm index 5721506..17ac68c 100644 --- a/_release/help/commands/3d_commands/CameraFogColor.htm +++ b/_release/help/commands/3d_commands/CameraFogColor.htm @@ -1,85 +1,96 @@ -Command: CameraFogColor - - +Blitz3D Docs + - - -

  CameraFogColor camera,red#,green#,blue#  

- -

-Parameters:
-

- - - - +

CameraFogColor camera,red#,green#,blue#

+

Parameters

+
camera - camera handle
- red# - red value of value
- green# - green value of fog
- blue# - blue value of fog
+ + +
+camera - camera handle
+red# - red value of value
+green# - green value of fog
+blue# - blue value of fog +
-

Description:
-
- - - - +

Description

+
Sets camera fog color.
+ + +
+Sets camera fog color. +
-

Example:
-
- - - - - +

Example

+
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
+ + +
+; CameraFogColor 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 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

- +
+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:
-

- - - - +

CameraFogMode camera,mode

+

Parameters

+
camera - sets camera fog mode
- mode - fog mode
- 0: no fog
- 1: linear fog
+ + +
+camera - camera handle
+
+mode -
+0: no fog (default)
+1: linear fog +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; 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
+ + +
+; 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

- +
+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:
-

- - - - +

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
+ + +
+camera - camera handle
+near# - distance in front of camera that fog starts
+far# - distance in front of camera that fog ends +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; 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 +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CameraPick.htm b/_release/help/commands/3d_commands/CameraPick.htm index f6d0bd7..3306dee 100644 --- a/_release/help/commands/3d_commands/CameraPick.htm +++ b/_release/help/commands/3d_commands/CameraPick.htm @@ -1,43 +1,98 @@ -Command: CameraPick - - +Blitz3D Docs + - - -

  CameraPick ( camera,viewport_x#,viewport_y# -)  

- -

-Parameters:
-

- - - - +

CameraPick ( camera,viewport_x#,viewport_y# )

+

Parameters

+
camera - camera handle
- viewport_x# - 2D viewport coordinate
- viewport_z# - 2D viewport coordinate
+ + +
+camera - camera handle
+viewport_x# - 2D viewport coordinate
+viewport_z# - 2D viewport coordinate +
-

Description:
-
- - - - +

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'.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; CameraPick Example
+; ------------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CameraProject camera,x#,y#,z#

+

Parameters

+
camera - camera handle
- x# - world coordinate x
- y# - world coordinate y
- z# - world coordinate z
+ + +
+camera - camera handle
+x# - world coordinate x
+y# - world coordinate y
+z# - world coordinate z +
-

Description:
-
- - - - +

Description

+
Projects the world coordinates x,y,z on to the 2D screen. Returns true - if the coordinates are on-screen.
+ + +
+Projects the world coordinates x,y,z on to the 2D screen. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

+ + +
+Sets camera range.
+
+Try and keep the ratio of far/near as small as possible for optimal z-buffer performance. Defaults to 1,1000. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; 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 +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CameraZoom.htm b/_release/help/commands/3d_commands/CameraZoom.htm index ef91094..d23103f 100644 --- a/_release/help/commands/3d_commands/CameraZoom.htm +++ b/_release/help/commands/3d_commands/CameraZoom.htm @@ -1,38 +1,92 @@ -Command: CameraZoom - - +Blitz3D Docs + - - -

  CameraZoom camera,zoom#  

- -

-Parameters:
-

- - - - +

CameraZoom camera,zoom#

+

Parameters

+
camera - camera handle
- zoom# - zoom factor of camera
+ + +
+camera - camera handle
+zoom# - zoom factor of camera +
-

Description:
-
- - - - +

Description

+
Sets zoom factor for a camera. Defaults to 1.
+ + +
+Sets zoom factor for a camera. Defaults to 1. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+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:
-

- - - - +

CaptureWorld

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; CaptureWorld and RenderWorld with tween.
+
+; Left/Right arrow keys change tween. Escape quits.
+
+Const width = 640, height = 480
+Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205
+
+Graphics3D 640, 480
+AmbientLight 50, 50, 50
+
+c1 = CreateCone( )
+PositionEntity c1, -5, 0, 0 ; on the left side of the screen
+ScaleEntity c1, 1, 3, 1
+EntityColor c1, 255, 0, 0
+
+cam = CreateCamera()
+PositionEntity cam, 0, 0, -50
+CameraZoom cam, 4
+
+lt = CreateLight() : TurnEntity lt, 30, 40, 0
+
+
+c2 = CopyEntity( c1 )
+
+CaptureWorld ; with c1 and c2 identically placed
+
+MoveEntity c2, 8, 0, 0 ; to the right side of the screen
+TurnEntity c2, 0, 0, 90 ; and tilted
+
+tw# = 100 ; 100 * tween
+
+; Interpolate between the pre-CaptureWorld ( tween = 0 )
+; arrangement and the current one ( tween = 1 ).
+
+While Not KeyDown( KEY_ESC )
+
+If KeyDown( KEY_LEFT ) Then tw = tw - 1
+If KeyDown( KEY_RIGHT ) Then tw = tw + 1
+RenderWorld tw / 100
+Text 250, 100, "tween = " + ( tw / 100 )
+Flip
+
+Wend
+
+End +
-

Index

- +
+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:
-

- - - - +

ClearCollisions

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; ClearCollisions Example
- ; -----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- sphere=CreateSphere( 32 )
- PositionEntity sphere,-2,0,5
-
- cone=CreateCone( 32 )
- EntityType cone,type_cone
- PositionEntity cone,2,0,5
-
- ; Set collision type values
- type_sphere=1
- type_cone=2
-
- ; Set up sphere collision data
- EntityRadius sphere,1
- EntityType sphere,type_sphere
-
- ; Set up cone collision data
- EntityType cone,type_cone
-
- ; Enable collisions between type_sphere and type_cone, with sphere->polygon - method and slide response
- Collisions type_sphere,type_cone,2,2
-
- While Not KeyDown( 1 )
-
- x#=0
- y#=0
- z#=0
-
- If KeyDown( 203 )=True Then x#=-0.1
- If KeyDown( 205 )=True Then x#=0.1
- If KeyDown( 208 )=True Then y#=-0.1
- If KeyDown( 200 )=True Then y#=0.1
- If KeyDown( 44 )=True Then z#=-0.1
- If KeyDown( 30 )=True Then z#=0.1
-
- MoveEntity sphere,x#,y#,z#
-
- ; If spacebar pressed then clear collisions
- If KeyHit( 57 )=True Then ClearCollisions
-
- ; Perform collision checking
- UpdateWorld
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move sphere"
- Text 0,20,"Press spacebar to use ClearCollisions command"
-
- Flip
-
- Wend
-
- End
+ + +
+; ClearCollisions Example
+; -----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+sphere=CreateSphere( 32 )
+PositionEntity sphere,-2,0,5
+
+cone=CreateCone( 32 )
+EntityType cone,type_cone
+PositionEntity cone,2,0,5
+
+; Set collision type values
+type_sphere=1
+type_cone=2
+
+; Set up sphere collision data
+EntityRadius sphere,1
+EntityType sphere,type_sphere
+
+; Set up cone collision data
+EntityType cone,type_cone
+
+; Enable collisions between type_sphere and type_cone, with sphere->polygon method and slide response
+Collisions type_sphere,type_cone,2,2
+
+While Not KeyDown( 1 )
+
+x#=0
+y#=0
+z#=0
+
+If KeyDown( 203 )=True Then x#=-0.1
+If KeyDown( 205 )=True Then x#=0.1
+If KeyDown( 208 )=True Then y#=-0.1
+If KeyDown( 200 )=True Then y#=0.1
+If KeyDown( 44 )=True Then z#=-0.1
+If KeyDown( 30 )=True Then z#=0.1
+
+MoveEntity sphere,x#,y#,z#
+
+; If spacebar pressed then clear collisions
+If KeyHit( 57 )=True Then ClearCollisions
+
+; Perform collision checking
+UpdateWorld
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to move sphere"
+Text 0,20,"Press spacebar to use ClearCollisions command"
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ClearSurface.htm b/_release/help/commands/3d_commands/ClearSurface.htm index bae5045..8b4fefe 100644 --- a/_release/help/commands/3d_commands/ClearSurface.htm +++ b/_release/help/commands/3d_commands/ClearSurface.htm @@ -1,49 +1,34 @@ -Command: ClearSurface - - +Blitz3D Docs + - - -

  ClearSurface -surface,[clear_verts][,clear_triangles]  

- -

-Parameters:
-

- - - - +

ClearSurface surface,[clear_verts][,clear_triangles]

+

Parameters

+
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:
-
- - - - +

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).

-
+ + +
+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). +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ClearTextureFilters.htm b/_release/help/commands/3d_commands/ClearTextureFilters.htm index 166b688..1c20d12 100644 --- a/_release/help/commands/3d_commands/ClearTextureFilters.htm +++ b/_release/help/commands/3d_commands/ClearTextureFilters.htm @@ -1,37 +1,87 @@ -Command: ClearTextureFilters - - +Blitz3D Docs + - - -

  ClearTextureFilters  

- -

-Parameters:
-

- - - - +

ClearTextureFilters

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Clears the current texture filter list.
+ + +
+Clears the current texture filter list. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+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:
-

- - - - +

ClearWorld [entities][,brushes][,textures]

+

Parameters

+
None.
+ + +
+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:
-
- - - - +

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.

-

See also: FreeEntity, - FreeBrush, FreeTexture.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CollisionEntity.htm b/_release/help/commands/3d_commands/CollisionEntity.htm index 1a48926..d6e2bc4 100644 --- a/_release/help/commands/3d_commands/CollisionEntity.htm +++ b/_release/help/commands/3d_commands/CollisionEntity.htm @@ -1,40 +1,32 @@ -Command: CollisionEntity - - +Blitz3D Docs + - - -

  CollisionEntity ( entity,index )  

- -

-Parameters:
-

- - - - +

CollisionEntity ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the other entity involved in a particular collision. Index - should be in the range 1...CountCollisions( - entity ), inclusive.
+ + +
+Returns the other entity involved in a particular collision. Index should be in the range 1...CountCollisions( entity ), inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CollisionNX.htm b/_release/help/commands/3d_commands/CollisionNX.htm index 933e6dd..3a0f1a1 100644 --- a/_release/help/commands/3d_commands/CollisionNX.htm +++ b/_release/help/commands/3d_commands/CollisionNX.htm @@ -1,42 +1,34 @@ -Command: CollisionNY - - +Blitz3D Docs + - - -

  CollisionNX# ( entity,index )  

- -

-Parameters:
-

- - - - +

CollisionNX# ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the x component of the normal of a particular collision.

Index should - be in the range 1...CountCollisions( - entity ) inclusive.

-

See also: CollisionNY, - CollisionNZ.

+ + +
+Returns the x component of the normal of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

CollisionNY# ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the y component of the normal of a particular collision.

Index should - be in the range 1...CountCollisions( - entity ) inclusive.

-

See also: CollisionNX, - CollisionNZ.

+ + +
+Returns the y component of the normal of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

CollisionNZ# ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the z component of the normal of a particular collision.

Index should - be in the range 1...CountCollisions( - entity ) inclusive.

-

See also: CollisionNX, - CollisionNY.

+ + +
+Returns the z component of the normal of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

CollisionSurface ( entity,index )

+

Parameters

+
<param description>
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the handle of the surface belonging to the specified entity that was closest to the point of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ), inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
<example>
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CollisionTime.htm b/_release/help/commands/3d_commands/CollisionTime.htm index 4ce3508..c0b46df 100644 --- a/_release/help/commands/3d_commands/CollisionTime.htm +++ b/_release/help/commands/3d_commands/CollisionTime.htm @@ -1,37 +1,34 @@ -Command: CollisionTime - - +Blitz3D Docs + - - -

  CollisionTime  

- -

-Parameters:
-

- - - - +

CollisionTime ( entity,index )

+

Parameters

+
<param description>
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the time taken to calculate a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
<example>
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CollisionTriangle.htm b/_release/help/commands/3d_commands/CollisionTriangle.htm index 337468d..741070f 100644 --- a/_release/help/commands/3d_commands/CollisionTriangle.htm +++ b/_release/help/commands/3d_commands/CollisionTriangle.htm @@ -1,37 +1,34 @@ -Command: CollisionTriangle - - +Blitz3D Docs + - - -

  CollisionTriangle  

- -

-Parameters:
-

- - - - +

CollisionTriangle ( entity,index )

+

Parameters

+
<param description>
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the index number of the triangle belonging to the specified entity that was closest to the point of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ), inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
<example>
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CollisionX.htm b/_release/help/commands/3d_commands/CollisionX.htm index e128ddb..d6551e7 100644 --- a/_release/help/commands/3d_commands/CollisionX.htm +++ b/_release/help/commands/3d_commands/CollisionX.htm @@ -1,42 +1,34 @@ -Command: CollisionX - - +Blitz3D Docs + - - -

  CollisionX# ( entity,index )  

- -

-Parameters:
-

- - - - +

CollisionX# ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the world x coordinate of a particular collision.

Index should - be in the range 1...CountCollisions( - entity ) inclusive.

-

See also: CollisionY, - CollisionZ.

+ + +
+Returns the world x coordinate of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

CollisionY# ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the world y coordinate of a particular collision.

Index should - be in the range 1...CountCollisions( - entity ) inclusive.

-

See also: CollisionX, - CollisionZ.

+ + +
+Returns the world y coordinate of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

CollisionZ# ( entity,index )

+

Parameters

+
entity - entity handle
- index - index of collision
+ + +
+entity - entity handle
+index - index of collision +
-

Description:
-
- - - - +

Description

+
Returns the world z coordinate of a particular collision.

Index should - be in the range 1...CountCollisions( - entity ) inclusive.

-

See also: CollisionX, - CollisionZ.

+ + +
+Returns the world z coordinate of a particular collision.
+
+Index should be in the range 1...CountCollisions( entity ) inclusive. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; Collisions Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- ; Set collision type values
- type_character=1
- type_scenery=2
-
- camera=CreateCamera()
- RotateEntity camera,45,0,0
- PositionEntity camera,0,15,-10
-
- light=CreateLight()
- RotateEntity light,45,0,0
-
- ; Create sphere 'character'
- sphere=CreateSphere( 32 )
- EntityRadius sphere,1
- EntityType sphere,type_character
- PositionEntity sphere,0,7,0
-
- ; Create cube 'scenery'
- cube=CreateCube()
- EntityRadius cube,1
- EntityType cube,type_scenery
- PositionEntity cube,0,-5,0
- EntityColor cube,127,0,0
- ScaleEntity cube,10,10,10
-
- ; Create cylinder 'scenery'
- cylinder=CreateCylinder( 32 )
- ScaleEntity cylinder,2,2,2
- EntityColor cylinder,255,0,0
- EntityType cylinder,type_scenery
- PositionEntity cylinder,-4,7,-4
-
- ; Create cone 'scenery'
- cone=CreateCone( 32 )
- ScaleEntity cone,2,2,2
- EntityColor cone,255,0,0
- EntityType cone,type_scenery
- PositionEntity cone,4,7,-4
-
- ; Create prism 'scenery'
- prism=CreateCylinder( 3 )
- ScaleEntity prism,2,2,2
- EntityColor prism,255,0,0
- EntityType prism,type_scenery
- PositionEntity prism,-4,7,4
- RotateEntity prism,0,180,0
-
- ; Create pyramid 'scenery'
- pyramid=CreateCone( 4 )
- ScaleEntity pyramid,2,2,2
- EntityColor pyramid,255,0,0
- EntityType pyramid,type_scenery
- RotateEntity pyramid,0,45,0
- PositionEntity pyramid,4,7,4
-
- ; Set collision method and response values
- method=2
- response=2
-
- method_info$="sphere-to-polygon"
- response_info$="slide1"
-
- While Not KeyDown( 1 )
-
- x#=0
- y#=0
- z#=0
-
- If KeyDown( 203 )=True Then x#=-0.1
- If KeyDown( 205 )=True Then x#=0.1
- If KeyDown( 208 )=True Then z#=-0.1
- If KeyDown( 200 )=True Then z#=0.1
-
- MoveEntity sphere,x#,y#,z#
- MoveEntity sphere,0,-0.02,0
-
- ; Change collision method
- If KeyHit(50)=True
- method=method+1
- If method=4 Then method=1
- If method=1 Then method_info$="sphere-to-sphere"
- If method=2 Then method_info$="sphere-to-polygon"
- If method=3 Then method_info$="sphere-to-box"
- EndIf
-
- ; Change collision response
- If KeyHit(19)=True
- response=response+1
- If response=4 Then response=1
- If response=1 Then response_info$="stop"
- If response=2 Then response_info$="slide1"
- If response=3 Then response_info$="slide2"
- EndIf
-
- ; Enable Collions between type_character and type_scenery
- Collisions type_character,type_scenery,method,response
-
- ; Perform collision checking
- UpdateWorld
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move sphere"
- Text 0,20,"Press M to change collision Method (currently: "+method_info$+")"
- Text 0,40,"Press R to change collision Response (currently: "+response_info$+")"
- Text 0,60,"Collisions type_character,type_scenery,"+method+","+response
-
- Flip
-
- Wend
-
- End
+ + +
+; Collisions Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+; Set collision type values
+type_ground=1
+type_character=2
+type_scenery=3
+
+camera=CreateCamera()
+RotateEntity camera,45,0,0
+PositionEntity camera,0,15,-10
+
+light=CreateLight()
+RotateEntity light,45,0,0
+
+; Create cube 'ground'
+cube=CreateCube()
+ScaleEntity cube,10,10,10
+EntityColor cube,0,127,0
+EntityType cube,type_ground
+PositionEntity cube,0,-5,0
+
+; Create sphere 'character'
+sphere=CreateSphere( 32 )
+EntityColor sphere,127,0,0
+EntityRadius sphere,1
+EntityType sphere,type_character
+PositionEntity sphere,0,7,0
+
+; Enable collisions between type_character and type_ground
+Collisions type_character,type_ground,2,2
+
+; Create cylinder 'scenery'
+cylinder=CreateCylinder( 32 )
+ScaleEntity cylinder,2,2,2
+EntityColor cylinder,0,0,255
+EntityRadius cylinder,2
+EntityBox cylinder,-2,-2,-2,4,4,4
+EntityType cylinder,type_scenery
+PositionEntity cylinder,-4,7,-4
+
+; Create cone 'scenery'
+cone=CreateCone( 32 )
+ScaleEntity cone,2,2,2
+EntityColor cone,0,0,255
+EntityRadius cone,2
+EntityBox cone,-2,-2,-2,4,4,4
+EntityType cone,type_scenery
+PositionEntity cone,4,7,-4
+
+; Create prism 'scenery'
+prism=CreateCylinder( 3 )
+ScaleEntity prism,2,2,2
+EntityColor prism,0,0,255
+EntityRadius prism,2
+EntityBox prism,-2,-2,-2,4,4,4
+EntityType prism,type_scenery
+PositionEntity prism,-4,7,4
+RotateEntity prism,0,180,0
+
+; Create pyramid 'scenery'
+pyramid=CreateCone( 4 )
+ScaleEntity pyramid,2,2,2
+EntityColor pyramid,0,0,255
+EntityRadius pyramid,2
+EntityBox pyramid,-2,-2,-2,4,4,4
+EntityType pyramid,type_scenery
+RotateEntity pyramid,0,45,0
+PositionEntity pyramid,4,7,4
+
+; Set collision method and response values
+method=2
+response=2
+
+method_info$="ellipsoid-to-polygon"
+response_info$="slide1"
+
+While Not KeyDown( 1 )
+
+x#=0
+y#=0
+z#=0
+
+If KeyDown( 203 )=True Then x#=-0.1
+If KeyDown( 205 )=True Then x#=0.1
+If KeyDown( 208 )=True Then z#=-0.1
+If KeyDown( 200 )=True Then z#=0.1
+
+MoveEntity sphere,x#,y#,z#
+MoveEntity sphere,0,-0.02,0 ; gravity
+
+; Change collision method
+If KeyHit( 50 )=True
+method=method+1
+If method=4 Then method=1
+If method=1 Then method_info$="ellipsoid-to-sphere"
+If method=2 Then method_info$="ellipsoid-to-polygon"
+If method=3 Then method_info$="ellipsoid-to-box"
+EndIf
+
+; Change collision response
+If KeyHit( 19 )=True
+response=response+1
+If response=4 Then response=1
+If response=1 Then response_info$="stop"
+If response=2 Then response_info$="slide1"
+If response=3 Then response_info$="slide2"
+EndIf
+
+; Enable collisions between type_character and type_scenery
+Collisions type_character,type_scenery,method,response
+
+; Perform collision checking
+UpdateWorld
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move sphere"
+Text 0,20,"Press M to change collision Method (currently: "+method_info$+")"
+Text 0,40,"Press R to change collision Response (currently: "+response_info$+")"
+Text 0,60,"Collisions type_character,type_scenery,"+method+","+response
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CopyEntity.htm b/_release/help/commands/3d_commands/CopyEntity.htm index 85e0b30..49edf12 100644 --- a/_release/help/commands/3d_commands/CopyEntity.htm +++ b/_release/help/commands/3d_commands/CopyEntity.htm @@ -1,40 +1,80 @@ -Command: CopyEntity - - +Blitz3D Docs + - - -

  CopyEntity ( entity[,parent] )  

- -

-Parameters:
-

- - - - +

CopyEntity ( entity[,parent] )

+

Parameters

+
entity - entity handle
- parent (optional) - parent entity of copied entity
+ + +
+entity - Entity Handle
+parent (optional) - Entity that will act as Parent to the copy. +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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 +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CountChildren.htm b/_release/help/commands/3d_commands/CountChildren.htm index 86bd546..3e7521f 100644 --- a/_release/help/commands/3d_commands/CountChildren.htm +++ b/_release/help/commands/3d_commands/CountChildren.htm @@ -1,37 +1,40 @@ -Command: CountChildren - - +Blitz3D Docs + - - -

  CountChildren ( entity )  

- -

-Parameters:
-

- - - - +

CountChildren ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns the number of children of an entity.
+ + +
+Returns the number of children of an entity. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+If CountChildren(entity) > 0
+For childcount = 1 to CountChildren(entity)
+child = GetChild(entity,childcount)
+Next
+Endif +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CountCollisions.htm b/_release/help/commands/3d_commands/CountCollisions.htm index 5bdec5d..c3b5090 100644 --- a/_release/help/commands/3d_commands/CountCollisions.htm +++ b/_release/help/commands/3d_commands/CountCollisions.htm @@ -1,38 +1,31 @@ -Command: CountCollisions - - +Blitz3D Docs + - - -

  CountCollisions ( entity )  

- -

-Parameters:
-

- - - - +

CountCollisions ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns how many collisions an entity was involved in during the last - UpdateWorld.
+ + +
+Returns how many collisions an entity was involved in during the last UpdateWorld. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CountSurfaces.htm b/_release/help/commands/3d_commands/CountSurfaces.htm index f1c89b0..a9b7cf3 100644 --- a/_release/help/commands/3d_commands/CountSurfaces.htm +++ b/_release/help/commands/3d_commands/CountSurfaces.htm @@ -1,39 +1,32 @@ -Command: CountSurfaces - - +Blitz3D Docs + - - -

  CountSurfaces ( mesh )  

- -

-Parameters:
-

- - - - +

CountSurfaces ( mesh )

+

Parameters

+
mesh - mesh handle
+ + +
+mesh - mesh handle +
-

Description:
-
- - - - +

Description

+
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.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/CountTriangles.htm b/_release/help/commands/3d_commands/CountTriangles.htm index 9974e7b..78252e5 100644 --- a/_release/help/commands/3d_commands/CountTriangles.htm +++ b/_release/help/commands/3d_commands/CountTriangles.htm @@ -1,37 +1,28 @@ -Command: CountTriangles - - +Blitz3D Docs + - - -

  CountTriangles ( surface )  

- -

-Parameters:
-

- - - - +

CountTriangles ( surface )

+

Parameters

+
surface - surface handle
+ + +
+surface - surface handle +
-

Description:
-
- - - - +

Description

+
Returns the number of triangles in a surface.
+ + +
+Returns the number of triangles in a surface. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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 + - - -

  CountVertices ( surface )  

- -

-Parameters:
-

- - - - +

CountVertices ( surface )

+

Parameters

+
surface - surface handle
+ + +
+surface - surface handle +
-

Description:
-
- - - - +

Description

+
Returns the number of vertices in a surface.
+ + +
+Returns the number of vertices in a surface. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

CreateBrush ( [red#][,green#][,blue#] )

+

Parameters

+
red# (optional) - brush red value
- green# (optional) - brush green value
- blue# (optional) - brush blue value
+ + +
+red# (optional) - brush red value
+green# (optional) - brush green value
+blue# (optional) - brush blue value +
-

Description:
-
- - - - +

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.

See also: - LoadBrush.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateBrush Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture("../media/b3dlogo.jpg")
-
- ; Create brush
- brush=CreateBrush()
-
- ; Apply texture to brush
- BrushTexture brush,tex
-
- ; And some shininess
- BrushShininess brush,1
-
- ; Paint mesh with brush
- PaintMesh cube,brush
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; CreateBrush Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture("media/b3dlogo.jpg")
+
+; Create brush
+brush=CreateBrush()
+
+; Apply texture to brush
+BrushTexture brush,tex
+
+; And some shininess
+BrushShininess brush,1
+
+; Paint mesh with brush
+PaintMesh cube,brush
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+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:
-

- - - - +

CreateCamera ( [parent] )

+

Parameters

+
parent (optional) - parent entity of camera
+ + +
+parent (optional) - parent entity of camera +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateCamera Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- ; Create camera
- camera=CreateCamera()
-
- light=CreateLight()
-
- cone=CreateCone()
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; CreateCamera Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+; Create camera
+camera=CreateCamera()
+
+light=CreateLight()
+
+cone=CreateCone()
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreateCone ( [segments][,solid][,parent] )

+

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.
+ + +
+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:
-
- - - - +

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.

-

See also: - CreateCube, CreateSphere, - CreateCylinder.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateCone Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create cone
- cone=CreateCone()
-
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; CreateCone Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create cone
+cone=CreateCone()
+
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreateCube( [parent] )

+

Parameters

+
parent (optional) - parent entity of cube
+ + +
+[parent] (optional) - This allows you to set the parent entity of Cube. +
-

Description:
-
- - - - +

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.

-

See also: - CreateSphere, - CreateCylinder, CreateCone.

+ + +
+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(). +
-

Example:
-
- - - - - +

Example

+
; CreateCube Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create cube
- cube=CreateCube()
-
- PositionEntity cube,0,0,5
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; CreateCube Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create cube
+cube=CreateCube()
+
+PositionEntity cube,0,0,5
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreateCylinder ( [segments][,solid][,parent] )

+

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.
+ + +
+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:
-
- - - - +

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.

-

See also: - CreateCube, - CreateSphere, CreateCone.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateCylinder Example
- ; ----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create cylinder
- cylinder=CreateCylinder()
-
- PositionEntity cylinder,0,0,5
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; CreateCylinder Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create cylinder
+cylinder=CreateCylinder()
+
+PositionEntity cylinder,0,0,5
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreateLight ( [type][,parent] )

+

Parameters

+
type (optional) - type of light
- 1: directional
- 2: point
- 3: spot
-
- parent (optional) - parent entity of light
+ + +
+type (optional) - type of light
+1: directional (default)
+2: point
+3: spot
+
+parent (optional) - parent entity of light +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+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 +
-

Index

- - \ 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 + - - -

  CreateListener ( parent[,rolloff_factor#][,doppler_scale#][,distance_scale#] -)  

- -

-Parameters:
-

- - - - +

CreateListener ( parent[,rolloff_factor#][,doppler_scale#][,distance_scale#] )

+

Parameters

+
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:
-
- - - - +

Description

+
Creates a listener entity and returns its handle. Currently, only a - single listener is supported.
+ + +
+Creates a listener entity and returns its handle. Currently, only a single listener is supported. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+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:
-

- - - - +

CreateMesh([parent])

+

Parameters

+
parent (optional) - parent entity of mesh
+ + +
+parent (optional) - This optional parameter allows you to specify another entity which will act as the parent to this mesh. +
-

Description:
-
- - - - +

Description

+
Creates a mesh and returns a mesh handle.
+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+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:
-

- - - - +

CreateMirror ( [parent] )

+

Parameters

+
parent - parent entity of mirror
+ + +
+parent - parent entity of mirror +
-

Description:
-
- - - - +

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.

-

See also: CreatePlane.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateMirror Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,0,1,-5
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create cone
- cone=CreateCone(32)
- PositionEntity cone,0,2,0
-
- ; Create plane
- plane=CreatePlane()
- grass_tex=LoadTexture( "media/chorme-2.bmp" )
- EntityTexture plane,grass_tex
- EntityAlpha plane,0.5
-
- ; Create mirror
- mirror=CreateMirror()
-
- While Not KeyDown( 1 )
-
- If KeyDown( 203 )=True Then MoveEntity cone,-0.1,0,0
- If KeyDown( 205 )=True Then MoveEntity cone,0.1,0,0
- If KeyDown( 208 )=True Then MoveEntity cone,0,-0.1,0
- If KeyDown( 200 )=True Then MoveEntity cone,0,0.1,0
- If KeyDown( 44 )=True Then MoveEntity cone,0,0,-0.1
- If KeyDown( 30 )=True Then MoveEntity cone,0,0,0.1
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move cone above infinite mirror"
-
- Flip
-
- Wend
-
- End
+ + +
+; CreateMirror Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,-5
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create cone
+cone=CreateCone(32)
+PositionEntity cone,0,2,0
+
+; Create plane
+plane=CreatePlane()
+grass_tex=LoadTexture( "media/chorme-2.bmp" )
+EntityTexture plane,grass_tex
+EntityAlpha plane,0.5
+
+; Create mirror
+mirror=CreateMirror()
+
+While Not KeyDown( 1 )
+
+If KeyDown( 203 )=True Then MoveEntity cone,-0.1,0,0
+If KeyDown( 205 )=True Then MoveEntity cone,0.1,0,0
+If KeyDown( 208 )=True Then MoveEntity cone,0,-0.1,0
+If KeyDown( 200 )=True Then MoveEntity cone,0,0.1,0
+If KeyDown( 44 )=True Then MoveEntity cone,0,0,-0.1
+If KeyDown( 30 )=True Then MoveEntity cone,0,0,0.1
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to move cone above infinite mirror"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreatePivot ( [parent] )

+

Parameters

+
parent (optional) - parent entity of pivot
+ + +
+parent (optional) - parent entity of pivot +
-

Description:
-
- - - - +

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.

-
-
+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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 +
-

Index

- - \ 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:
-

- - - - +

CreatePlane ( [sub_divs][,parent] )

+

Parameters

+
sub_divs - sub divisions of plane
- parent (optional) - parent entity of plane
+ + +
+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:
-
- - - - +

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.

-

See also: CreateMirror.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreatePlane Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,0,1,0
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create plane
- plane=CreatePlane()
-
- grass_tex=LoadTexture( "media/mossyground.bmp" )
-
- EntityTexture plane,grass_tex
-
- 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
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the infinite plane"
-
- Flip
-
- Wend
-
- End
+ + +
+; CreatePlane Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,0
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create plane
+plane=CreatePlane()
+
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+
+EntityTexture plane,grass_tex
+
+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
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the infinite plane"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreateSphere ( [segments][,parent] )

+

Parameters

+
segments (optional) - sphere detail. Defaults to 8.
- parent (optional) - parent entity of sphere
+ + +
+segments (optional) - sphere detail. Defaults to 8.
+parent (optional) - parent entity of sphere +
-

Description:
-
- - - - +

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.

-

See also: - CreateCube, - CreateCylinder, CreateCone.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateSphere Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create sphere
- sphere=CreateSphere()
-
- PositionEntity sphere,0,0,5
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; CreateSphere Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create sphere
+sphere=CreateSphere()
+
+PositionEntity sphere,0,0,5
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

CreateSprite ( [parent] )

+

Parameters

+
parent (optional) - parent entity of sprite
+ + +
+parent (optional) - parent entity of sprite +
-

Description:
-
- - - - +

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.

-
-

See also: LoadSprite.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+cam = CreateCamera()
+MoveEntity cam,0,0,-5
+
+sp = CreateSprite()
+RotateSprite sp,20
+
+RenderWorld:Flip
+WaitKey
+End +
-

Index

- - \ 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 + - - -

  CreateSurface ( mesh[,brush] )  

- -

-Parameters:
-

- - - - +

CreateSurface ( mesh[,brush] )

+

Parameters

+
mesh - mesh handle
- brush (optional) - brush handle
+ + +
+mesh - mesh handle
+brush (optional) - brush handle +
-

Description:
-
- - - - +

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.

-
+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+mesh = CreateMesh()
+surf = CreateSurface(mesh)
+
+v0 = AddVertex (surf, -5,-5,0, 0 ,0)
+v1 = AddVertex (surf, 5,-5,0, 1 ,0)
+v2 = AddVertex (surf, 0, 5,0, 0.5,1)
+
+tri = AddTriangle (surf,v0,v2,v1)
+
+cam = CreateCamera()
+MoveEntity cam, 0,0,-7
+
+RenderWorld
+Flip
+
+WaitKey
+End +
-

Index

- +
+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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

-

See also: LoadTerrain.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateTerrain Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,0,1,0
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Create terrain
- terrain=CreateTerrain(128)
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex
-
- 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
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
-
- Flip
-
- Wend
-
- End
+ + +
+; CreateTerrain Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,1,0
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create terrain
+terrain=CreateTerrain(128)
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex
+
+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
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

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
+ + +
+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:
-
- - - - +

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.

See also: - LoadTexture, - LoadAnimTexture.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; CreateTexture Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Create texture of size 256x256
- tex=CreateTexture(256,256)
-
- ; Set buffer - texture buffer
- SetBuffer TextureBuffer(tex)
-
- ; Clear texture buffer with background white color
- ClsColor 255,255,255
- Cls
-
- ; Draw text on texture
- font=LoadFont("arial",24)
- SetFont font
- Color 0,0,0
- Text 0,0,"This texture"
- Text 0,40,"was created using" : Color 0,0,255
- Text 0,80,"CreateTexture()" : Color 0,0,0
- Text 0,120,"and drawn to using" : Color 0,0,255
- Text 0,160,"SetBuffer TextureBuffer()"
-
- ; Texture cube with texture
- EntityTexture cube,tex
-
- ; Set buffer - backbuffer
- SetBuffer BackBuffer()
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; CreateTexture Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Create texture of size 256x256
+tex=CreateTexture( 256,256 )
+
+; Set buffer - texture buffer
+SetBuffer TextureBuffer( tex )
+
+; Clear texture buffer with background white color
+ClsColor 255,255,255
+Cls
+
+; Draw text on texture
+font=LoadFont( "arial",24 )
+SetFont font
+Color 0,0,0
+Text 0,0,"This texture"
+Text 0,40,"was created using" : Color 0,0,255
+Text 0,80,"CreateTexture()" : Color 0,0,0
+Text 0,120,"and drawn to using" : Color 0,0,255
+Text 0,160,"SetBuffer TextureBuffer()"
+
+; Texture cube with texture
+EntityTexture cube,tex
+
+; Set buffer - backbuffer
+SetBuffer BackBuffer()
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+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:
-

- - - - +

Dither enable

+

Parameters

+
enable - true to enable dithering, false to disable. Defaults to true.
+ + + +
+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. +
+

Example

+ + + +
+; 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.
-

Example:
-
- - - - - -
; 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
-

Index

- +Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EmitSound.htm b/_release/help/commands/3d_commands/EmitSound.htm index b158c8c..066d504 100644 --- a/_release/help/commands/3d_commands/EmitSound.htm +++ b/_release/help/commands/3d_commands/EmitSound.htm @@ -1,39 +1,82 @@ -Command: EmitSound - - +Blitz3D Docs + - - -

  EmitSound sound,entity  

- -

-Parameters:
-

- - - - +

EmitSound( sound,entity )

+

Parameters

+
sound - sound handle
- entity - entity handle
+ + +
+sound - sound handle
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Emits a sound attached to the specified entity and returns a sound - channel.

The sound must have been loaded using Load3DSound for 3D effects.

+ + +
+Emits a sound attached to the specified entity and returns a sound channel.
+
+The sound must have been loaded using Load3DSound for 3D effects. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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 +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityAlpha.htm b/_release/help/commands/3d_commands/EntityAlpha.htm index a301cc0..7e2637b 100644 --- a/_release/help/commands/3d_commands/EntityAlpha.htm +++ b/_release/help/commands/3d_commands/EntityAlpha.htm @@ -1,50 +1,87 @@ -Command: EntityAlpha - - +Blitz3D Docs + - - -

  EntityAlpha entity,alpha#  

- -

-Parameters:
-

- - - - +

EntityAlpha entity,alpha#

+

Parameters

+
entity - entity handle
- alpha# - alpha level of entity
+ + +
+Entity - entity handle
+Alpha# - alpha level of entity +
-

Description:
-
- - - - +

Description

+
Sets the entity alpha level of an entity.

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; EntityAlpha Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+Back=CreateCube()
+
+PositionEntity cube,0,0,5
+PositionEntity back,0,0,15
+ScaleEntity Back,10,2,1
+EntityColor back,255,0,0
+; Set initial entity color values
+Alpha#=1
+
+While Not KeyDown( 1 )
+
+; Change alpha value depending on key pressed
+If alpha#<0.01 Then alpha# = 0
+If alpha#>1 Then alpha# = 1
+If KeyDown( 2 )=True And Alpha#>0 Then Alpha#=Alpha#-0.01
+If KeyDown( 3 )=True And alpha#<1 Then Alpha#=Alpha#+0.01
+; Set entity alpha value
+EntityAlpha cube,Alpha#
+
+
+TurnEntity cube,0.1,0.1,0.1
+TurnEntity back,1,0,0
+
+RenderWorld
+
+Text 0,0,"Press keys 1-2 to change EntityAlpha"
+Text 0,20,"Entity Alpha: "+Alpha
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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:
-

- - - - +

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)
+ + +
+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:
-
- - - - +

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.
+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityBlend.htm b/_release/help/commands/3d_commands/EntityBlend.htm index 293a8b1..408da81 100644 --- a/_release/help/commands/3d_commands/EntityBlend.htm +++ b/_release/help/commands/3d_commands/EntityBlend.htm @@ -1,43 +1,176 @@ -Command: EntityBlend - - +Blitz3D Docs + - - -

  EntityBlend entity,blend  

- -

-Parameters:
-

- - - - +

EntityBlend Entity, Blend

+

Parameters

+
entity - entity handle
-
- blend - blend mode of entity
- 0: disable texture
- 1: alpha
- 2: multiply (default)
- 3: add
+ + +
+Entity - Entity handle
+
+Blend - Blend mode of the entity.
+1: Alpha (default)
+2: Multiply
+3: Add +
-

Description:
-
- - - - +

Description

+
Sets the blending mode of an entity.
+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+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

- +
+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:
-

- - - - +

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
+ + +
+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 +
-

Description:
-
- - - - +

Description

+
Sets the dimensions of an entity's collision box.
+ + +
+Sets the dimensions of an entity's collision box. +
+
+See also: EntityRadius, Collisions, EntityType. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityCollided.htm b/_release/help/commands/3d_commands/EntityCollided.htm index bdce9f1..c2dd2db 100644 --- a/_release/help/commands/3d_commands/EntityCollided.htm +++ b/_release/help/commands/3d_commands/EntityCollided.htm @@ -1,39 +1,32 @@ -Command: EntityCollided - - +Blitz3D Docs + - - -

  EntityCollided ( entity,type )  

- -

-Parameters:
-

- - - - +

EntityCollided ( entity,type )

+

Parameters

+
entity - entity handle
- type - type of entity
+ + +
+entity - entity handle
+type - type of entity +
-

Description:
-
- - - - +

Description

+
Returns true if an entity collided with any other entity of the - specified type.
+ + +
+Returns the handle of the entity of the specified type that collided with the specified entity. +
+
+See also: CollisionX, CollisionY, CollisionZ, CollisionNX, CollisionNY, CollisionNZ, CountCollisions, EntityCollided, CollisionTime, CollisionEntity, CollisionSurface, CollisionTriangle. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

EntityColor entity,red#,green#,blue#

+

Parameters

+
entity - entity handle
- red# - red value of entity
- green# - green value of entity
- blue# - blue value of entity
+ + +
+entity - entity handle
+Red# - red value of entity
+Green# - green value of entity
+Blue# - blue value of entity +
-

Description:
-
- - - - +

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.

-
+ + +
+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). +
-

Example:
-
- - - - - +

Example

+
; 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
+ + +
+; 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 +
-

Index

- - \ 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 + - - -

  EntityDistance# ( src_entity,dest_entity)  

- -

-Parameters:
-

- - - - +

EntityDistance# ( src_entity,dest_entity)

+

Parameters

+
src_entity - source entity handle
- dest_entity - destination entity handle
+ + +
+src_entity - source entity handle
+dest_entity - destination entity handle +
-

Description:
-
- - - - +

Description

+
Returns the distance between src_entity and dest_entity.
+ + +
+Returns the distance between src_entity and dest_entity. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

EntityFX entity,fx

+

Parameters

+
entity - entity handle
-
- fx -
- 1: full-bright
- 2: use vertex colors instead of brush color
- 4: flatshaded
- 8: disable fog
+ + +
+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:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

EntityInView ( entity,camera )

+

Parameters

+
entity - entity handle
- camera - camera handle
+ + +
+entity - entity handle
+camera - camera handle +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityName.htm b/_release/help/commands/3d_commands/EntityName.htm index 6373f13..360f98d 100644 --- a/_release/help/commands/3d_commands/EntityName.htm +++ b/_release/help/commands/3d_commands/EntityName.htm @@ -1,38 +1,31 @@ -Command: EntityName$ - - +Blitz3D Docs + - - -

  EntityName$ ( entity )  

- -

-Parameters:
-

- - - - +

EntityName$ ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns the name of an entity. An entity's name may be set in a - modelling program, or manually set using NameEntity.
+ + +
+Returns the name of an entity. An entity's name may be set in a modelling program, or manually set using NameEntity. +
+
+See also: NameEntity. +
-

Example:
-
- - - - - -
none.
-

Index

- +
+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:
-

- - - - +

EntityOrder entity,order

+

Parameters

+
entity - entity handle
- order - order that entity will be drawn in
+ + +
+entity - entity handle
+order - order that entity will be drawn in +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

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.
+ + +
+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:
-
- - - - +

Description

+
Attaches an entity to a parent.

Parent may be 0, in which case the - entity will have no parent.

+ + +
+Attaches an entity to a parent.
+
+Parent may be 0, in which case the entity will have no parent. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

EntityPick ( entity,range# )

+

Parameters

+
entity - entity handle
- range# - range of pick area around entity
+ + +
+entity - entity handle
+range# - range of pick area around entity +
-

Description:
-
- - - - +

Description

+
Returns the nearest entity 'ahead' of the specified entity. An entity - must have a non-zero EntityPickMode to be - pickable.
+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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:
-

- - - - +

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.
+ + +
+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:
-
- - - - +

Description

+
Sets the pick mode for an entity.
+ + +
+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. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+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:
-

- - - - +

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.
+ + + +
+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. +
+

Example

+ + + +
+; EntityPitch Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cone,pitch#,yaw#,roll#
+
+RenderWorld
+
+Text 0,0,"Use cursor/Z/X keys to turn cone"
+
+; Return entity pitch angle of cone
+Text 0,20,"Pitch: "+EntityPitch#( cone )
+
+Flip
+
+Wend
+
+End +
-

Description:
-
- - - - -
Returns the pitch angle of an entity.

-The pitch angle is also the x angle of an entity.
-

Example:
-
- - - - - -
; EntityPitch Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cone,pitch#,yaw#,roll#
-
- RenderWorld
-
- Text 0,0,"Use cursor/Z/X keys to turn cone"
-
- ; Return entity pitch angle of cone
- Text 0,20,"Pitch: "+EntityPitch#( cone )
-
- Flip
-
- Wend
-
- End
-

Index

- +Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityRadius.htm b/_release/help/commands/3d_commands/EntityRadius.htm index 9740716..755b4fc 100644 --- a/_release/help/commands/3d_commands/EntityRadius.htm +++ b/_release/help/commands/3d_commands/EntityRadius.htm @@ -1,108 +1,108 @@ -Command: EntityRadius - - +Blitz3D Docs + - - -

  EntityRadius entity,radius#  

- -

-Parameters:
-

- - - - +

EntityRadius entity,x_radius#[,y_radius#]

+

Parameters

+
entity - entity handle
- radius# - radius of entity's collision sphere
+ + +
+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:
-
- - - - +

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).

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
; EntityRadius Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- sphere=CreateSphere( 32 )
- PositionEntity sphere,-2,0,5
-
- cone=CreateCone( 32 )
- EntityType cone,type_cone
- PositionEntity cone,2,0,5
-
- ; Set collision type values
- type_sphere=1
- type_cone=2
-
- ; Set sphere radius value
- sphere_radius#=1
-
- ; Set sphere and cone entity types
- EntityType sphere,type_sphere
- EntityType cone,type_cone
-
- ; Enable collisions between type_sphere and type_cone, with sphere->polygon - method and slide response
- Collisions type_sphere,type_cone,2,2
-
- While Not KeyDown( 1 )
-
- x#=0
- y#=0
- z#=0
-
- If KeyDown( 203 )=True Then x#=-0.1
- If KeyDown( 205 )=True Then x#=0.1
- If KeyDown( 208 )=True Then y#=-0.1
- If KeyDown( 200 )=True Then y#=0.1
- If KeyDown( 44 )=True Then z#=-0.1
- If KeyDown( 30 )=True Then z#=0.1
-
- MoveEntity sphere,x#,y#,z#
-
- ; If square brackets keys pressed then change sphere radius value
- If KeyDown( 26 )=True Then sphere_radius#=sphere_radius#-0.1
- If KeyDown( 27 )=True Then sphere_radius#=sphere_radius#+0.1
-
- ; Set entity radius of sphere
- EntityRadius sphere,sphere_radius#
-
- ; Perform collision checking
- UpdateWorld
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move sphere"
- Text 0,20,"Press [ or ] to change EntityRadius value"
- Text 0,40,"EntityRadius sphere,"+sphere_radius
-
- Flip
-
- Wend
-
- End
+ + +
+; EntityRadius Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+sphere=CreateSphere( 32 )
+PositionEntity sphere,-2,0,5
+
+cone=CreateCone( 32 )
+EntityType cone,type_cone
+PositionEntity cone,2,0,5
+
+; Set collision type values
+type_sphere=1
+type_cone=2
+
+; Set sphere radius value
+sphere_radius#=1
+
+; Set sphere and cone entity types
+EntityType sphere,type_sphere
+EntityType cone,type_cone
+
+; Enable collisions between type_sphere and type_cone, with ellipsoid->polygon method and slide response
+Collisions type_sphere,type_cone,2,2
+
+While Not KeyDown( 1 )
+
+x#=0
+y#=0
+z#=0
+
+If KeyDown( 203 )=True Then x#=-0.1
+If KeyDown( 205 )=True Then x#=0.1
+If KeyDown( 208 )=True Then y#=-0.1
+If KeyDown( 200 )=True Then y#=0.1
+If KeyDown( 44 )=True Then z#=-0.1
+If KeyDown( 30 )=True Then z#=0.1
+
+MoveEntity sphere,x#,y#,z#
+
+; If square brackets keys pressed then change sphere radius value
+If KeyDown( 26 )=True Then sphere_radius#=sphere_radius#-0.1
+If KeyDown( 27 )=True Then sphere_radius#=sphere_radius#+0.1
+
+; Set entity radius of sphere
+EntityRadius sphere,sphere_radius#
+
+; Perform collision checking
+UpdateWorld
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to move sphere"
+Text 0,20,"Press [ or ] to change EntityRadius radius_x# value"
+Text 0,40,"EntityRadius sphere,"+sphere_radius
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+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:
-

- - - - +

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.
+ + + +
+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. +
+

Example

+ + + +
+; EntityRoll Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cone,pitch#,yaw#,roll#
+
+RenderWorld
+
+Text 0,0,"Use cursor/Z/X keys to turn cone"
+
+; Return entity roll angle of cone
+Text 0,20,"Roll: "+EntityRoll#( cone )
+
+Flip
+
+Wend
+
+End +
-

Description:
-
- - - - -
Returns the roll angle of an entity.

-The roll angle is also the z angle of an entity.
-

Example:
-
- - - - - -
; EntityRoll Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cone,pitch#,yaw#,roll#
-
- RenderWorld
-
- Text 0,0,"Use cursor/Z/X keys to turn cone"
-
- ; Return entity roll angle of cone
- Text 0,20,"Roll: "+EntityRoll#( cone )
-
- Flip
-
- Wend
-
- End
-

Index

- +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:
-

- - - - +

EntityShininess Entity, Shininess#

+

Parameters

+
entity - entity handle
- shininess# - shininess of entity
+ + +
+Entity - entity handle
+Shininess# - shininess of entity +
-

Description:
-
- - - - +

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.

+ + +
+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. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; EntityShininess Example
+; -----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+camera=CreateCamera()
+; Set ambient light to a low level, to increase effect of shininess
+
+AmbientLight 32,32,32
+light=CreateLight()
+RotateEntity light,45,45,0
+
+sphere=CreateSphere(100)
+EntityColor Sphere,255,0,0
+PositionEntity sphere,0,0,4
+
+; Set initial shine value
+
+shine#=0
+
+While Not KeyDown(1)
+; Change shine value depending on key pressed
+
+If KeyDown(2)=True And shine#>0 Then shine#=shine#-0.01
+If KeyDown(3)=True And shine#<1 Then shine#=shine#+0.01
+
+; Set entity shininess using shine value
+EntityShininess sphere,shine#
+
+RenderWorld
+
+Text 0,0,"Press keys 1-2 to change EntityShininess Setting"
+Text 0,20,"Entity Shininess: "+shine#
+
+Flip
+Wend
+End +
-

Index

- - \ 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:
-

- - - - +

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.
+ + +
+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:
-
- - - - +

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.

+ + +
+Applies a texture to an entity.
+
+The optional frame parameter specifies which texture animation frame should be used as the texture.
+
+The optional index parameter specifies which index number should be assigned to the texture. Index numbers are used for the purpose of multitexturing. See TextureBlend.
+
+A little note about multitexturing and slowdown. Graphics cards support a maximum amount of textures per object, which can be used with very little, if any, slowdown. For most cards this is two, but for a GeForce3 it is four. However, once you use more than this amount, Blitz will emulate the effect itself by duplicating objects and textures. Obviously, this may then cause slowdown. +
-

Example:
-
- - - - - +

Example

+
; EntityTexture Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture( "media/b3dlogo.jpg" )
-
- ; Texture entity
- EntityTexture cube,tex
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; EntityTexture Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Texture entity
+EntityTexture cube,tex
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityType.htm b/_release/help/commands/3d_commands/EntityType.htm index f679fc6..6cd28c9 100644 --- a/_release/help/commands/3d_commands/EntityType.htm +++ b/_release/help/commands/3d_commands/EntityType.htm @@ -1,40 +1,35 @@ -Command: EntityType - - +Blitz3D Docs + - - -

  EntityType entity,collision_type[,recursive]  

- -

-Parameters:
-

- - - - +

EntityType entity,collision_type[,recursive]

+

Parameters

+
entity - entity handle
- collision_type - collision type of entity
- recursive (optional) - true to apply collision type to entity's children. - Defaults to false.
+ + +
+entity - entity handle
+collision_type - collision type of entity. Must be in the range 0-999.
+recursive (optional) - true to apply collision type to entity's children. Defaults to false. +
-

Description:
-
- - - - +

Description

+
Sets the collision type for an entity.
+ + +
+Sets the collision type for an entity.
+
+A collision_type value of 0 indicates that no collision checking will occur with that entity. A collision value of 1-999 will mean collision checking will occur. +
+
+See also: Collisions, GetEntityType, EntityBox, EntityRadius. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityVisible.htm b/_release/help/commands/3d_commands/EntityVisible.htm index f7d9cec..82c27a3 100644 --- a/_release/help/commands/3d_commands/EntityVisible.htm +++ b/_release/help/commands/3d_commands/EntityVisible.htm @@ -1,38 +1,29 @@ -Command: EntityVisible - - +Blitz3D Docs + - - -

  EntityVisible ( src_entity,dest_entity )  

- -

-Parameters:
-

- - - - +

EntityVisible ( src_entity,dest_entity )

+

Parameters

+
src_entity - source entity handle
- dest_entity - destination entity handle
+ + +
+src_entity - source entity handle
+dest_entity - destination entity handle +
-

Description:
-
- - - - +

Description

+
Returns true if src_entity and dest_entity can 'see' each other.
+ + +
+Returns true if src_entity and dest_entity can 'see' each other. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityX.htm b/_release/help/commands/3d_commands/EntityX.htm index 6d129c4..591d51b 100644 --- a/_release/help/commands/3d_commands/EntityX.htm +++ b/_release/help/commands/3d_commands/EntityX.htm @@ -1,77 +1,179 @@ -Command: EntityX - - +Blitz3D Docs + - - -

  EntityX# ( entity[,global] )  

- -

-Parameters:
-

- - - - +

EntityX# ( entity[,global] )

+

Parameters

+
entity - name of entity that will have x-coordinate returned
-global (optional) - true if the x-coordinate returned should be relative to -0,0,0 rather than a parent entity's position. False by default.
+ + +
+entity = handle of Loaded or Created Entity
+global = True for Global coordinates, False for Local. Optional, defaults to False. +
-

Description:
-
- - - - +

Description

+
Returns the x-coordinate of an entity.
+ + +
+The X-coordinate of the entity.
+If the global flag is set to False then the parent's local coordinate system is used.
+
+NOTE: If the entity has no parent then local and global coordinates are the same.
+In this case you can think of the 3d world as the parent.
+
+Global coordinates refer to the 3d world. Blitz 3D uses a left-handed system:
+
+X+ is to the right
+Y+ is up
+Z+ is forward ( into the screen )
+
+Every entity also has its own Local coordinate system.
+
+The global system never changes.
+But the local system is carried along as an entity moves and turns.
+
+This same concept is used in the entity movement commands:
+
+MoveEntity entity, 0,0,1
+
+No matter what the orientation this moves one unit forward. +
-

Example:
-
- - - - - +

Example

+
; EntityX Example
- ; ---------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,10
-
- While Not KeyDown( 1 )
-
- x#=0
- y#=0
- z#=0
-
- If KeyDown(203)=True Then x#=-0.1
- If KeyDown(205)=True Then x#=0.1
- If KeyDown(208)=True Then y#=-0.1
- If KeyDown(200)=True Then y#=0.1
- If KeyDown(44)=True Then z#=-0.1
- If KeyDown(30)=True Then z#=0.1
-
- MoveEntity cone,x#,y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move cone"
-
- ; Return entity x position of cone
- Text 0,20,"X Position: "+EntityX#( cone )
-
- Flip
-
- Wend
-
- End
+ + +
+; EntityX / EntityY / EntityZ example.
+
+; Escape quits, other keys move or pause the display.
+
+Const width = 640, height = 480
+Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205
+
+Graphics3D 640, 480
+AmbientLight 50, 50, 50
+
+Global isMoving = False ; used to pause/resume movement
+Global count ; how many updates have been done
+
+
+; Set up a camera, light and three entities...
+
+cam = CreateCamera()
+PositionEntity cam, 0, 2, -50
+CameraZoom cam, 4
+
+lt = CreateLight() : TurnEntity lt, 30, 40, 0
+
+
+Global oSphere, pCone, cSphere
+
+oSphere = CreateSphere()
+EntityColor oSphere, 250, 50, 0 ; Orange = Origin, parent of cone
+
+pCone = CreateCone( 8, True, oSphere) ; will be a parent of small sphere
+ScaleEntity pCone, .8, 2.0, .8
+PositionEntity pCone, 8, 0, 0
+EntityColor pCone, 255, 255, 0
+
+cSphere = CreateSphere( 8, pCone ) ; child of the cone
+EntityColor cSphere, 150, 150, 0
+ScaleEntity cSphere, .4/.8, .4/2.0, .4/.8 ; try commenting out this line
+PositionEntity cSphere, 0, 2, 0 ; above parent
+
+; ... and we are ready run.
+
+While Not KeyDown( KEY_ESC )
+
+UpdateEverything
+RenderWorld
+ShowInfo
+
+Flip
+
+Wend
+
+End
+
+
+
+Function UpdateEverything( )
+
+; Nothing moves relative to its parent, so local coordinates are constant.
+; Try uncommenting the PositionEntity command to change this.
+
+
+If GetKey() Then isMoving = Not isMoving
+
+If isMoving
+TurnEntity oSphere, 0, .5, 0
+TurnEntity pCone, .2, 0, 0
+
+count = count + 1
+a# = count Mod 360
+; PositionEntity cSphere, 0, 2 + Sin( a ), 0 ; experiment with this
+
+End If
+
+End Function
+
+Function ShowInfo( ) ; global and local coordinates for all entities
+Local x$, y$, z$
+
+Color 255, 255, 255
+Text 185, 20, "Global"
+Text 495, 20, "Local"
+
+Color 250, 50, 0
+Text 20, 50, "oSphere: " + XYZ( oSphere, True )
+Text 400, 50, XYZ( oSphere, False )
+
+Color 255, 255, 0
+Text 20, 75, " pCone: " + XYZ( pCone, True )
+Text 400, 75, XYZ( pCone, False )
+
+Color 150, 150, 0
+Text 20, 100, "cSphere: " + XYZ( cSphere, True )
+Text 400, 100, XYZ( cSphere, False )
+
+End Function
+
+; ******************************************************************
+
+; These two functions just format the text display.
+; Without them there are too many numbers crowding the screen.
+
+Function Round#( x#, m# ) ; returns x rounded to multiple of m
+If m < 0.0 Then m = -m
+s# = Sgn( x )
+If x < 0.0 Then x = -x
+diff# = x Mod m
+If diff < .5 * m
+Return ( x - diff ) * s
+Else
+Return ( m + x - diff ) * s
+End If
+End Function
+
+
+Function XYZ$( entity, globalFlag )
+
+ex# = Round( EntityX( entity, globalFlag ), .001 )
+ey# = Round( EntityY( entity, globalFlag ), .001 )
+ez# = Round( EntityZ( entity, globalFlag ), .001 )
+
+Return RSet( ex, 8 ) + RSet( ey, 8 ) + RSet( ez, 8 )
+
+End Function +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityY.htm b/_release/help/commands/3d_commands/EntityY.htm index 3511126..5db59eb 100644 --- a/_release/help/commands/3d_commands/EntityY.htm +++ b/_release/help/commands/3d_commands/EntityY.htm @@ -1,77 +1,161 @@ -Command: EntityX - - +Blitz3D Docs + - - -

  EntityY# ( entity[,global] )  

- -

-Parameters:
-

- - - - +

EntityY# ( entity[,global] )

+

Parameters

+
entity - name of entity that will have y-coordinate returned
-global (optional) - true if the y-coordinate returned should be relative to -0,0,0 rather than a parent entity's position. False by default.
+ + +
+entity = handle of Loaded or Created Entity
+global = True for Global coordinates, False for Local. Optional, defaults to False. +
-

Description:
-
- - - - +

Description

+
Returns the y-coordinate of an entity.
+ + +
+The Y-coordinate of the entity.
+If the global flag is set to False then the parent's local coordinate system is used.
+
+See EntityX() for an overview of Local and Global coordinates. +
-

Example:
-
- - - - - +

Example

+
; EntityY Example
- ; ---------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,10
-
- While Not KeyDown( 1 )
-
- x#=0
- y#=0
- z#=0
-
- If KeyDown(203)=True Then x#=-0.1
- If KeyDown(205)=True Then x#=0.1
- If KeyDown(208)=True Then y#=-0.1
- If KeyDown(200)=True Then y#=0.1
- If KeyDown(44)=True Then z#=-0.1
- If KeyDown(30)=True Then z#=0.1
-
- MoveEntity cone,x#,y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move cone"
-
- ; Return entity y position of cone
- Text 0,20,"Y Position: "+EntityY#( cone )
-
- Flip
-
- Wend
-
- End
+ + +
+; EntityX / EntityY / EntityZ example.
+
+; Escape quits, other keys move or pause the display.
+
+Const width = 640, height = 480
+Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205
+
+Graphics3D 640, 480
+AmbientLight 50, 50, 50
+
+Global isMoving = False ; used to pause/resume movement
+Global count ; how many updates have been done
+
+
+; Set up a camera, light and three entities...
+
+cam = CreateCamera()
+PositionEntity cam, 0, 2, -50
+CameraZoom cam, 4
+
+lt = CreateLight() : TurnEntity lt, 30, 40, 0
+
+
+Global oSphere, pCone, cSphere
+
+oSphere = CreateSphere()
+EntityColor oSphere, 250, 50, 0 ; Orange = Origin, parent of cone
+
+pCone = CreateCone( 8, True, oSphere) ; will be a parent of small sphere
+ScaleEntity pCone, .8, 2.0, .8
+PositionEntity pCone, 8, 0, 0
+EntityColor pCone, 255, 255, 0
+
+cSphere = CreateSphere( 8, pCone ) ; child of the cone
+EntityColor cSphere, 150, 150, 0
+ScaleEntity cSphere, .4/.8, .4/2.0, .4/.8 ; try commenting out this line
+PositionEntity cSphere, 0, 2, 0 ; above parent
+
+; ... and we are ready run.
+
+While Not KeyDown( KEY_ESC )
+
+UpdateEverything
+RenderWorld
+ShowInfo
+
+Flip
+
+Wend
+
+End
+
+
+
+Function UpdateEverything( )
+
+; Nothing moves relative to its parent, so local coordinates are constant.
+; Try uncommenting the PositionEntity command to change this.
+
+
+If GetKey() Then isMoving = Not isMoving
+
+If isMoving
+TurnEntity oSphere, 0, .5, 0
+TurnEntity pCone, .2, 0, 0
+
+count = count + 1
+a# = count Mod 360
+; PositionEntity cSphere, 0, 2 + Sin( a ), 0 ; experiment with this
+
+End If
+
+End Function
+
+Function ShowInfo( ) ; global and local coordinates for all entities
+Local x$, y$, z$
+
+Color 255, 255, 255
+Text 185, 20, "Global"
+Text 495, 20, "Local"
+
+Color 250, 50, 0
+Text 20, 50, "oSphere: " + XYZ( oSphere, True )
+Text 400, 50, XYZ( oSphere, False )
+
+Color 255, 255, 0
+Text 20, 75, " pCone: " + XYZ( pCone, True )
+Text 400, 75, XYZ( pCone, False )
+
+Color 150, 150, 0
+Text 20, 100, "cSphere: " + XYZ( cSphere, True )
+Text 400, 100, XYZ( cSphere, False )
+
+End Function
+
+; ******************************************************************
+
+; These two functions just format the text display.
+; Without them there are too many numbers crowding the screen.
+
+Function Round#( x#, m# ) ; returns x rounded to multiple of m
+If m < 0.0 Then m = -m
+s# = Sgn( x )
+If x < 0.0 Then x = -x
+diff# = x Mod m
+If diff < .5 * m
+Return ( x - diff ) * s
+Else
+Return ( m + x - diff ) * s
+End If
+End Function
+
+
+Function XYZ$( entity, globalFlag )
+
+ex# = Round( EntityX( entity, globalFlag ), .001 )
+ey# = Round( EntityY( entity, globalFlag ), .001 )
+ez# = Round( EntityZ( entity, globalFlag ), .001 )
+
+Return RSet( ex, 8 ) + RSet( ey, 8 ) + RSet( ez, 8 )
+
+End Function +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityYaw.htm b/_release/help/commands/3d_commands/EntityYaw.htm index 1ef92dc..1509243 100644 --- a/_release/help/commands/3d_commands/EntityYaw.htm +++ b/_release/help/commands/3d_commands/EntityYaw.htm @@ -1,79 +1,77 @@ -Command: EntityPitch - - +Blitz3D Docs + - - -

  EntityYaw# ( entity[,global] )  

- -

-Parameters:
-

- - - - +

EntityYaw# ( entity[,global] )

+

Parameters

+
entity - name of entity that will have yaw angle returned
-global (optional) - true if the yaw angle returned should be relative to 0 rather than a parent entity's - yaw angle. False by default.
+ + + +
+entity - name of entity that will have yaw angle returned
+global (optional) - true if the yaw angle returned should be relative to 0 rather than a parent entity's yaw angle. False by default. +
+

Description

+ + + + +
+Returns the yaw angle of an entity.
+
+The yaw angle is also the y angle of an entity. +
+

Example

+ + + +
+; EntityYaw Example
+; -----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cone,pitch#,yaw#,roll#
+
+RenderWorld
+
+Text 0,0,"Use cursor/Z/X keys to turn cone"
+
+; Return entity yaw angle of cone
+Text 0,20,"Yaw: "+EntityYaw#( cone )
+
+Flip
+
+Wend
+
+End +
-

Description:
-
- - - - -
Returns the yaw angle of an entity.

-The yaw angle is also the y angle of an entity.
-

Example:
-
- - - - - -
; EntityYaw Example
- ; -----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cone,pitch#,yaw#,roll#
-
- RenderWorld
-
- Text 0,0,"Use cursor/Z/X keys to turn cone"
-
- ; Return entity yaw angle of cone
- Text 0,20,"Yaw: "+EntityYaw#( cone )
-
- Flip
-
- Wend
-
- End
-

Index

- +Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/EntityZ.htm b/_release/help/commands/3d_commands/EntityZ.htm index f25b2a4..56b0073 100644 --- a/_release/help/commands/3d_commands/EntityZ.htm +++ b/_release/help/commands/3d_commands/EntityZ.htm @@ -1,77 +1,161 @@ -Command: EntityX - - +Blitz3D Docs + - - -

  EntityZ# ( entity[,global] )  

- -

-Parameters:
-

- - - - +

EntityZ# ( entity[,global] )

+

Parameters

+
entity - name of entity that will have z-coordinate returned
-global (optional) - true if the z-coordinate returned should be relative to -0,0,0 rather than a parent entity's position. False by default.
+ + +
+entity = handle of Loaded or Created Entity
+global = True for Global coordinates, False for Local. Optional, defaults to False. +
-

Description:
-
- - - - +

Description

+
Returns the z-coordinate of an entity.
+ + +
+The Z-coordinate of the entity.
+If the global flag is set to False then the parent's local coordinate system is used.
+
+See EntityX() for an overview of Local and Global coordinates. +
-

Example:
-
- - - - - +

Example

+
; EntityZ Example
- ; ---------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,10
-
- While Not KeyDown( 1 )
-
- x#=0
- y#=0
- z#=0
-
- If KeyDown(203)=True Then x#=-0.1
- If KeyDown(205)=True Then x#=0.1
- If KeyDown(208)=True Then y#=-0.1
- If KeyDown(200)=True Then y#=0.1
- If KeyDown(44)=True Then z#=-0.1
- If KeyDown(30)=True Then z#=0.1
-
- MoveEntity cone,x#,y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move cone"
-
- ; Return entity z position of cone
- Text 0,20,"Z Position: "+EntityZ#( cone )
-
- Flip
-
- Wend
-
- End
+ + +
+; EntityX / EntityY / EntityZ example.
+
+; Escape quits, other keys move or pause the display.
+
+Const width = 640, height = 480
+Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205
+
+Graphics3D 640, 480
+AmbientLight 50, 50, 50
+
+Global isMoving = False ; used to pause/resume movement
+Global count ; how many updates have been done
+
+
+; Set up a camera, light and three entities...
+
+cam = CreateCamera()
+PositionEntity cam, 0, 2, -50
+CameraZoom cam, 4
+
+lt = CreateLight() : TurnEntity lt, 30, 40, 0
+
+
+Global oSphere, pCone, cSphere
+
+oSphere = CreateSphere()
+EntityColor oSphere, 250, 50, 0 ; Orange = Origin, parent of cone
+
+pCone = CreateCone( 8, True, oSphere) ; will be a parent of small sphere
+ScaleEntity pCone, .8, 2.0, .8
+PositionEntity pCone, 8, 0, 0
+EntityColor pCone, 255, 255, 0
+
+cSphere = CreateSphere( 8, pCone ) ; child of the cone
+EntityColor cSphere, 150, 150, 0
+ScaleEntity cSphere, .4/.8, .4/2.0, .4/.8 ; try commenting out this line
+PositionEntity cSphere, 0, 2, 0 ; above parent
+
+; ... and we are ready run.
+
+While Not KeyDown( KEY_ESC )
+
+UpdateEverything
+RenderWorld
+ShowInfo
+
+Flip
+
+Wend
+
+End
+
+
+
+Function UpdateEverything( )
+
+; Nothing moves relative to its parent, so local coordinates are constant.
+; Try uncommenting the PositionEntity command to change this.
+
+
+If GetKey() Then isMoving = Not isMoving
+
+If isMoving
+TurnEntity oSphere, 0, .5, 0
+TurnEntity pCone, .2, 0, 0
+
+count = count + 1
+a# = count Mod 360
+; PositionEntity cSphere, 0, 2 + Sin( a ), 0 ; experiment with this
+
+End If
+
+End Function
+
+Function ShowInfo( ) ; global and local coordinates for all entities
+Local x$, y$, z$
+
+Color 255, 255, 255
+Text 185, 20, "Global"
+Text 495, 20, "Local"
+
+Color 250, 50, 0
+Text 20, 50, "oSphere: " + XYZ( oSphere, True )
+Text 400, 50, XYZ( oSphere, False )
+
+Color 255, 255, 0
+Text 20, 75, " pCone: " + XYZ( pCone, True )
+Text 400, 75, XYZ( pCone, False )
+
+Color 150, 150, 0
+Text 20, 100, "cSphere: " + XYZ( cSphere, True )
+Text 400, 100, XYZ( cSphere, False )
+
+End Function
+
+; ******************************************************************
+
+; These two functions just format the text display.
+; Without them there are too many numbers crowding the screen.
+
+Function Round#( x#, m# ) ; returns x rounded to multiple of m
+If m < 0.0 Then m = -m
+s# = Sgn( x )
+If x < 0.0 Then x = -x
+diff# = x Mod m
+If diff < .5 * m
+Return ( x - diff ) * s
+Else
+Return ( m + x - diff ) * s
+End If
+End Function
+
+
+Function XYZ$( entity, globalFlag )
+
+ex# = Round( EntityX( entity, globalFlag ), .001 )
+ey# = Round( EntityY( entity, globalFlag ), .001 )
+ez# = Round( EntityZ( entity, globalFlag ), .001 )
+
+Return RSet( ex, 8 ) + RSet( ey, 8 ) + RSet( ez, 8 )
+
+End Function +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FindChild.htm b/_release/help/commands/3d_commands/FindChild.htm index 75e54bd..4542b0b 100644 --- a/_release/help/commands/3d_commands/FindChild.htm +++ b/_release/help/commands/3d_commands/FindChild.htm @@ -1,39 +1,29 @@ -Command: FindChild - - +Blitz3D Docs + - - -

  FindChild ( entity,child_name$ )  

- -

-Parameters:
-

- - - - +

FindChild ( entity,child_name$ )

+

Parameters

+
entity - entity handle
- child_name$ - child name to find within entity
+ + +
+entity - entity handle
+child_name$ - child name to find within entity +
-

Description:
-
- - - - +

Description

+
Returns the first child of the specified entity with name matching - child_name$.
+ + +
+Returns the first child of the specified entity with name matching child_name$. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FindSurface.htm b/_release/help/commands/3d_commands/FindSurface.htm index 59d239b..a3098e7 100644 --- a/_release/help/commands/3d_commands/FindSurface.htm +++ b/_release/help/commands/3d_commands/FindSurface.htm @@ -1,41 +1,31 @@ -Command: FindSurface - - +Blitz3D Docs + - - -

  FindSurface ( mesh,brush)  

- -

-Parameters:
-

- - - - +

FindSurface ( mesh,brush)

+

Parameters

+
mesh - mesh handle
- brush - brush handle
+ + +
+mesh - mesh handle
+brush - brush handle +
-

Description:
-
- - - - +

Description

+
Attempts to find a surface attached to the specified mesh and created with the specified brush. - Returns the surface handle if found or 0 if not.

See also: - CountSurfaces, - GetSurface.

+ + +
+Attempts to find a surface attached to the specified mesh and created with the specified brush. Returns the surface handle if found or 0 if not.
+
+See also: CountSurfaces, GetSurface. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FitMesh.htm b/_release/help/commands/3d_commands/FitMesh.htm index afd8cd8..59d1d80 100644 --- a/_release/help/commands/3d_commands/FitMesh.htm +++ b/_release/help/commands/3d_commands/FitMesh.htm @@ -1,46 +1,124 @@ -Command: FitMesh - - +Blitz3D Docs + - - -

  FitMesh mesh,x#,y#,z#,width#,height#,depth#[,uniform]  

- -

-Parameters:
-

- - - - +

FitMesh mesh,x#,y#,z#,width#,height#,depth#[,uniform]

+

Parameters

+
mesh - mesh handle
- x# - x position of mesh
- y# - y position of mesh
- z# - z position of mesh
- width# - width of mesh
- height# - height of mesh
- depth# - depth of mesh
- uniform (optional) - if true, the mesh will be scaled  by the same - amounts in x, y and z, so will not be distorted. Defaults to false.
+ + +
+mesh - mesh handle
+x# - x position of mesh
+y# - y position of mesh
+z# - z position of mesh
+width# - width of mesh
+height# - height of mesh
+depth# - depth of mesh
+uniform (optional) - if true, the mesh will be scaled by the same amounts in x, y and z, so will not be distorted. Defaults to false. +
-

Description:
-
- - - - +

Description

+
Scales and translates all vertices of a mesh so that the mesh occupies - the specified box.
+ + +
+Scales and translates all vertices of a mesh so that the mesh occupies the specified box.
+
+Do not use a width#, height# or depth# value of 0, otherwise all mesh data will be destroyed and your mesh will not be displayed. Use a value of 0.001 instead for a flat mesh along one axis. +
+
+See also: ScaleMesh, ScaleEntity. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; FitMesh Example
+; ---------------
+
+; In this example we will demonstrate the use of the FitMesh command.
+
+; First we will use FitMesh on a semi-transparent blue box. This will represent the dimensions we will
+; be using with FitMesh.
+
+; Then we will use these dimensions on a red cone, so that it appears to fit inside the box when the
+; space bar is pressed.
+
+; The first time the space bar is pressed a uniform FitMesh will be performed, which means the cone
+; will be scaled equally along all axis so that at least one axis fits the dimensions specified.
+
+; The second time the space bar is pressed a non-unifrom FitMesh will be performed, meaning the cone
+; will be scaled non-equally along all axes so that all axes fit the dimensions specified.
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+; Create cube
+cube=CreateCube()
+
+; Set cube colour to blue
+EntityColor cube,0,0,255
+
+; Make cube semi-transparent so we will be able to see cone inside it later
+EntityAlpha cube,0.5
+
+; Use FitMesh on cube to make it a cuboid
+FitMesh cube,-1,-.5,-1,2,1,2
+
+; Position cube in front of camera so we can see it
+PositionEntity cube,0,-1,5
+
+; Create cone
+cone=CreateCone()
+
+; Set cone color to red
+EntityColor cone,255,0,0
+
+; Position cone in front of camera so we can see it
+PositionEntity cone,0,-1,5
+
+; Set uniform value to 1 so when space is first pressed, FitMesh will be uniform
+uniform=1
+
+While Not KeyDown(1)
+
+ ; If space bar pressed....
+ If KeyHit(57)=True
+
+ ; Set syntax string to show syntax useage
+ syntax$="FitMesh cone,-1,-.5,-1,2,1,2,"+uniform
+
+ ; Use FitMesh with cone, using same values as used with cube earlier. Cone should now fit in cube.
+ FitMesh cone,-1,-.5,-1,2,1,2,uniform
+
+ ; Change uniform value from 1 to 0 so when space bar is pressed again FitMesh will be non-uniform
+ uniform=0
+
+ EndIf
+
+ RenderWorld
+
+ Text 0,0,"Press space to use uniform FitMesh with cone"
+ Text 0,20,"Press space again to use non-uniform FitMesh with cone"
+ Text 0,40,syntax$
+
+ Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FlipMesh.htm b/_release/help/commands/3d_commands/FlipMesh.htm index 3f63866..0031747 100644 --- a/_release/help/commands/3d_commands/FlipMesh.htm +++ b/_release/help/commands/3d_commands/FlipMesh.htm @@ -1,86 +1,74 @@ -Command: FlipMesh - - +Blitz3D Docs + - - -

  FlipMesh mesh  

- -

-Parameters:
-

- - - - +

FlipMesh mesh

+

Parameters

+
mesh - mesh handle
+ + +
+mesh - mesh handle +
-

Description:
-
- - - - +

Description

+
Flips all the triangles in a mesh.

This is useful for a couple of reasons. - Firstly though, it is important to understand a little bit of the theory - behind 3D graphics. A 3D triangle is represented by three points; only when - these points are presented to the viewer in a clockwise-fashion is the - triangle visible. So really, triangles only have one side.

-

Normally, for example in the case of a sphere, a model's triangles face - the inside of the model, so it doesn't matter that you can't see them. - However, what about if you wanted to use the sphere as a huge sky for your - world, i.e. so you only needed to see the inside? In this case you would - just use FlipMesh.
-
- Another use for FlipMesh is to make objects two-sided, so you can see them - from the inside and outside if you can't already. In this case, you can copy - the original mesh using CopyEntity, specifying - the original mesh as the parent, and flip it using FlipMesh. You will now - have two meshes occupying the same space - this will make it double-sided, - but beware, it will also double the polygon count!

-

The above technique is worth trying when an external modelling program - has exported a model in such a way that some of the triangles appear to be - missing.

+ + +
+Flips all the triangles in a mesh.
+
+This is useful for a couple of reasons. Firstly though, it is important to understand a little bit of the theory behind 3D graphics. A 3D triangle is represented by three points; only when these points are presented to the viewer in a clockwise-fashion is the triangle visible. So really, triangles only have one side.
+
+Normally, for example in the case of a sphere, a model's triangles face the inside of the model, so it doesn't matter that you can't see them. However, what about if you wanted to use the sphere as a huge sky for your world, i.e. so you only needed to see the inside? In this case you would just use FlipMesh.
+
+Another use for FlipMesh is to make objects two-sided, so you can see them from the inside and outside if you can't already. In this case, you can copy the original mesh using CopyEntity, specifying the original mesh as the parent, and flip it using FlipMesh. You will now have two meshes occupying the same space - this will make it double-sided, but beware, it will also double the polygon count!
+
+The above technique is worth trying when an external modelling program has exported a model in such a way that some of the triangles appear to be missing. +
-

Example:
-
- - - - - +

Example

+
; FlipMesh Example
- ; ----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- ; Create sphere
- sphere=CreateSphere()
-
- ; Scale sphere
- ScaleEntity sphere,100,100,100
-
- ; Texture sphere with sky texture
- sky_tex=LoadTexture("../media/sky.bmp")
- EntityTexture sphere,sky_tex
-
- ; Flip mesh so we can see the inside of it
- FlipMesh sphere
-
- Color 0,0,0
-
- While Not KeyDown( 1 )
- RenderWorld
- Text 0,0,"You are viewing a flipped sphere mesh - makes a great sky!"
- Flip
- Wend
-
- End
+ + +
+; FlipMesh Example
+; ----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+; Create sphere
+sphere=CreateSphere()
+
+; Scale sphere
+ScaleEntity sphere,100,100,100
+
+; Texture sphere with sky texture
+sky_tex=LoadTexture("media/sky.bmp")
+EntityTexture sphere,sky_tex
+
+; Flip mesh so we can see the inside of it
+FlipMesh sphere
+
+Color 0,0,0
+
+While Not KeyDown( 1 )
+RenderWorld
+Text 0,0,"You are viewing a flipped sphere mesh - makes a great sky!"
+Flip
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FreeBrush.htm b/_release/help/commands/3d_commands/FreeBrush.htm index 3bd91d5..75f32e7 100644 --- a/_release/help/commands/3d_commands/FreeBrush.htm +++ b/_release/help/commands/3d_commands/FreeBrush.htm @@ -1,37 +1,28 @@ -Command: FreeBrush - - +Blitz3D Docs + - - -

  FreeBrush  

- -

-Parameters:
-

- - - - +

FreeBrush brush

+

Parameters

+
<param description>
+ + +
+brush - brush handle +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Frees up a brush. +
-

Example:
-
- - - - - -
<example>
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FreeEntity.htm b/_release/help/commands/3d_commands/FreeEntity.htm index dd66b5e..dc75180 100644 --- a/_release/help/commands/3d_commands/FreeEntity.htm +++ b/_release/help/commands/3d_commands/FreeEntity.htm @@ -1,37 +1,79 @@ -Command: FreeEntity - - +Blitz3D Docs + - - -

  FreeEntity entity  

- -

-Parameters:
-

- - - - +

FreeEntity EntityHandle

+

Parameters

+
entity - entity handle
+ + +
+EntityHandle - Handle returned by an Entity creating function such as CreateCube(), CreateLight(), LoadMesh() etc. +
-

Description:
-
- - - - +

Description

+
Frees up an entity.
+ + +
+FreeEntity will free up the internal resources associated with a particular entity and remove it from the scene.
+
+This command will also free all children entities parented to the entity.
+
+Note that the variable holding the handle (and any variables referencing children handles) are not reset as it is up to the Blitz programmer to zero or ignore their contents following a call to FreeEntity(). +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; FreeEntity Example
+; This example creates an entity and
+; allows you to move it, but shows
+; that a handle is no longer valid after
+; FreeEntity is used on it.
+; Run in Debug Mode
+
+Graphics3D 640,480
+AppTitle "FreeEntity Example"
+
+Cam = CreateCamera()
+Lit = CreateLight()
+
+PositionEntity Lit,-5,-5,0
+PositionEntity Cam,0,0,-5
+
+AnEntity = CreateCube() ; This is our Test Entity
+RotateMesh AnEntity,45,45,45
+
+While Not KeyDown(1) ; Until we press ESC
+
+; Use the Left or Right Arrows to Move the Entity
+If KeyDown(203) Then MoveEntity AnEntity,-0.1,0,0
+If KeyDown(205) Then MoveEntity AnEntity,0.1,0,0
+
+; Use the Space Key to Free the Entity. It will disappear
+; The next time you try to move it, you will get an error
+; Notice that the Handle Variable doesn't change after the
+; Entity is free. It simply becomes invalid.
+
+If KeyHit(57) Then FreeEntity AnEntity ; Hit Space to Free!
+
+RenderWorld ; Draw the Scene
+
+; What is in the AnEntity handle?
+Text 10,10,"Entity Handle: "+AnEntity
+Flip ; Flip it into View
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/FreeTexture.htm b/_release/help/commands/3d_commands/FreeTexture.htm index 5feaa9c..65e870d 100644 --- a/_release/help/commands/3d_commands/FreeTexture.htm +++ b/_release/help/commands/3d_commands/FreeTexture.htm @@ -1,85 +1,85 @@ -Command: FreeTexture - - +Blitz3D Docs + - - -

  FreeTexture texture  

- -

-Parameters:
-

- - - - +

FreeTexture texture

+

Parameters

+
texture - texture handle
+ + +
+texture - texture handle +
-

Description:
-
- - - - +

Description

+
Frees up a texture. This will allow the memory that it occupied before - to be used for other purposes.

Freeing a texture means you will not be - able to use it again; however, entities already textured with it will not - lose the texture.

+ + +
+Frees up a texture from memory.
+
+Freeing a texture means you will not be able to use it again; however, entities already textured with it will not lose the texture. +
-

Example:
-
- - - - - +

Example

+
; FreeTexture Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture("../media/b3dlogo.jpg")
-
- ; Texture cube with texture
- EntityTexture cube,tex
-
- While Not KeyDown( 1 )
-
- ; If spacebar pressed then free texture
- If KeyHit( 57 )=True Then FreeTexture tex
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Text 0,0,"Press spacebar to free texture"
- Text 0,20,"As you can see this will not effect already textured entities"
- Flip
-
- Wend
-
- End
+ + +
+; FreeTexture Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Texture cube with texture
+EntityTexture cube,tex
+
+While Not KeyDown( 1 )
+
+; If spacebar pressed then free texture
+If KeyHit( 57 )=True Then FreeTexture tex
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+
+Text 0,0,"Press spacebar to free texture"
+Text 0,20,"As you can see this will not affect already textured entities"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/GetChild.htm b/_release/help/commands/3d_commands/GetChild.htm index 419b4e5..e17779a 100644 --- a/_release/help/commands/3d_commands/GetChild.htm +++ b/_release/help/commands/3d_commands/GetChild.htm @@ -1,39 +1,29 @@ -Command: GetChild - - +Blitz3D Docs + - - -

  GetChild (entity,index)  

- -

-Parameters:
-

- - - - +

GetChild (entity,index)

+

Parameters

+
entity - entity handle
- index - index of child entity. Should be in the range 1...CountChildren( - entity ) inclusive.
+ + +
+entity - entity handle
+index - index of child entity. Should be in the range 1...CountChildren( entity ) inclusive. +
-

Description:
-
- - - - +

Description

+
Returns a child of an entity.
+ + +
+Returns a child of an entity. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/GetEntityType.htm b/_release/help/commands/3d_commands/GetEntityType.htm index 8f4a060..30cc21b 100644 --- a/_release/help/commands/3d_commands/GetEntityType.htm +++ b/_release/help/commands/3d_commands/GetEntityType.htm @@ -1,37 +1,31 @@ -Command: GetEntityType - - +Blitz3D Docs + - - -

  GetEntityType ( entity )  

- -

-Parameters:
-

- - - - +

GetEntityType ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns the collision type of an entity.
+ + +
+Returns the collision type of an entity as set by the EntityType command. +
+
+See also: EntityType, EntityBox, EntityRadius, Collisions, ResetEntity. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/GetParent.htm b/_release/help/commands/3d_commands/GetParent.htm index 6bb9c32..5c8e129 100644 --- a/_release/help/commands/3d_commands/GetParent.htm +++ b/_release/help/commands/3d_commands/GetParent.htm @@ -1,37 +1,28 @@ -Command: GetParent - - +Blitz3D Docs + - - -

  GetParent ( entity )  

- -

-Parameters:
-

- - - - +

GetParent ( entity )

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Returns an entity's parent.
+ + +
+Returns an entity's parent. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/GetSurface.htm b/_release/help/commands/3d_commands/GetSurface.htm index 9351694..7dd2631 100644 --- a/_release/help/commands/3d_commands/GetSurface.htm +++ b/_release/help/commands/3d_commands/GetSurface.htm @@ -1,43 +1,36 @@ -Command: GetSurface - - +Blitz3D Docs + - - -

  GetSurface ( mesh, index )  

- -

-Parameters:
-

- - - - +

GetSurface ( mesh, index )

+

Parameters

+
mesh - mesh handle
- index - index of surface
+ + +
+mesh - mesh handle
+index - index of surface +
-

Description:
-
- - - - +

Description

+
Returns the handle of the surface attached to the specified mesh and - with the specified index number.

Index should be in the range 1...CountSurfaces( - mesh ), inclusive.

-

You need to 'get a surface', i.e. get its handle, in order to be able to - then use that particular surface with other commands.

-

See also: CountSurfaces.

+ + +
+Returns the handle of the surface attached to the specified mesh and with the specified index number.
+
+Index should be in the range 1...CountSurfaces( mesh ), inclusive.
+
+You need to 'get a surface', i.e. get its handle, in order to be able to then use that particular surface with other commands. +
+
+See also: CountSurfaces, FindSurface. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/GfxDriver3D.htm b/_release/help/commands/3d_commands/GfxDriver3D.htm index a61cf9a..828b01a 100644 --- a/_release/help/commands/3d_commands/GfxDriver3D.htm +++ b/_release/help/commands/3d_commands/GfxDriver3D.htm @@ -1,48 +1,47 @@ -Command: GfxDriver3D - - +Blitz3D Docs + - - -

  GfxDriver3D  

- -

-Parameters:
-

- - - - +

GfxDriver3D(driver)

+

Parameters

+
driver -- display driver number to check, from 1 to CountGfxDrivers ()
+ + +
+driver - display driver number to check, from 1 to CountGfxDrivers () +
-

Description:
-
- - -
GfxDriver3D returns True if the specified graphics driver is 3D-capable. -

-GfxDriver3D is generally used after obtaining a list of available graphics drivers from a user's system via CountGfxDrivers (). You apply this to each driver in turn (or a selected driver) to see if it is 3D-capable. If this returns False, the driver can not perform 3D operations. -

+

Description

+ + + - +
+GfxDriver3D returns True if the specified graphics driver is 3D-capable.
+
+GfxDriver3D is generally used after obtaining a list of available graphics drivers from a user's system via CountGfxDrivers(). You apply this to each driver in turn (or a selected driver) to see if it is 3D-capable. If this returns False, the driver can not perform 3D operations.
+
On systems with more than one display driver, you can use this to check each for 3D capability before choosing one via the SetGfxDriver command.
-

Example:
-
- - - - - +

Example

+
For a = 1 To CountGfxDrivers ()
- If GfxDriver3D (a)
- Print GfxDriverName (a) + " is 3D-capable"
- Else
- Print GfxDriverName (a) + " is NOT 3D-capable"
- EndIf
- Delay 100
-Next
+ + +
+For a = 1 To CountGfxDrivers ()
+If GfxDriver3D (a)
+Print GfxDriverName (a) + " is 3D-capable"
+Else
+Print GfxDriverName (a) + " is NOT 3D-capable"
+EndIf
+Delay 100
+Next +
- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/GfxMode3D.htm b/_release/help/commands/3d_commands/GfxMode3D.htm index 2302ab1..fb7412b 100644 --- a/_release/help/commands/3d_commands/GfxMode3D.htm +++ b/_release/help/commands/3d_commands/GfxMode3D.htm @@ -1,48 +1,47 @@ -Command: GfxMode3D - - +Blitz3D Docs + - - -

  GfxMode3D  

- -

-Parameters:
-

- - - - +

GfxMode3D(mode)

+

Parameters

+
mode - graphics mode number from 1 - CountGfxModes ()
+ + +
+mode - graphics mode number from 1 - CountGfxModes () +
-

Description:
-
- - -
GfxMode3D returns True if the specified graphics mode is 3D-capable. -

-GfxMode3D is generally used after obtaining a list of available display modes from a user's system via CountGfxModes (). You apply this to each mode in turn (or a selected mode) to see if you can enter 3D mode. If this returns False, calling Graphics3D () with this mode's details will fail! -

+

Description

+ + + - +
+GfxMode3D returns True if the specified graphics mode is 3D-capable.
+
+GfxMode3D is generally used after obtaining a list of available display modes from a user's system via CountGfxModes (). You apply this to each mode in turn (or a selected mode) to see if you can enter 3D mode. If this returns False, calling Graphics3D () with this mode's details will fail!
+
If you don't wish to perform this check, the only Graphics3D call you can make with a guarantee of working on 99% of 3D graphics cards is 'Graphics3D 640, 480'. However, see GfxModeExists' gfx3d parameter for another method of performing this check.
-

Example:
-
- - - - - +

Example

+
For a = 1 To CountGfxModes ()
- If GfxMode3D (a)
- Print "Mode " + a + " is 3D-capable"
- Else
- Print "Mode " + a + " is NOT 3D-capable"
- EndIf
- Delay 100
- Next
+ + +
+For a = 1 To CountGfxModes ()
+If GfxMode3D (a)
+Print "Mode " + a + " is 3D-capable"
+Else
+Print "Mode " + a + " is NOT 3D-capable"
+EndIf
+Delay 100
+Next +
- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/Graphics3D.htm b/_release/help/commands/3d_commands/Graphics3D.htm index cf43bc3..e190ea3 100644 --- a/_release/help/commands/3d_commands/Graphics3D.htm +++ b/_release/help/commands/3d_commands/Graphics3D.htm @@ -1,76 +1,70 @@ -Command: Graphics3D - - +Blitz3D Docs + - - -

  Graphics3D  

- -

-Parameters:
-

- - - - +

Graphics3D

+

Parameters

+
width - width of screen resolution
-height - height of screen resolution
-depth (optional) - colour depth of screen. Defaults to highest colour depth -available.
-
-mode (optional) - mode of display. Defaults to 0.
-0: windowed (if possible) in debug mode, fullscreen in non-debug mode
-1: fullscreen always
-2. windowed always
-3: windowed/scaled always
+ + +
+width - width of screen resolution
+height - height of screen resolution
+depth (optional) - colour depth of screen. Defaults to highest colour depth available.
+
+mode (optional) - mode of display. Defaults to 0.
+0: windowed (if possible) in debug mode, fullscreen in non-debug mode
+1: fullscreen always
+2. windowed always
+3: windowed/scaled always +
-

Description:
-
- - -
Sets 3D Graphics mode. This command must be executed before any other 3D -command, otherwise programs will return an error.
+

Description

+ + + - +See also: Graphics, EndGraphics. + +
+Sets 3D Graphics mode. This command must be executed before any other 3D command, otherwise programs will return an error.
+
+Width and height set the resolution of the screen and common values are 640,480 and 800,600. The resolution must be compatible with the 3D card and monitor being used.
+
+Depth sets the colour mode of the screen. If this value is omitted or set to 0, then the highest available colour depth available will be used. Other values usually available are 16, 24 and 32. 16-bit colour mode displays the least amount of colours, 65536. 24-bit and 32-bit colour modes display over 16 million colours and as a result offer a better quality picture, although may result in slower programs than 16-bit.
-Width and height set the resolution of the screen and common values are 640,480 -and 800,600. The resolution must be compatible with the 3D card and monitor -being used.

-Depth sets the colour mode of the screen. If this value is omitted or set to 0, -then the highest available colour depth available will be used. Other values -usually available are 16, 24 and 32. 16-bit colour mode displays the least -amount of colours, 65536. 24-bit and 32-bit colour modes display over 16 million -colours and as a result offer a better quality picture, although may result in -slower programs than 16-bit.
-

Example:
-
- - - - - +

Example

+
; Graphics3D Example
- ; ------------------
-
- ; Sets 3D graphics mode
- Graphics3D 640,480,16,0
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; Graphics3D Example
+; ------------------
+
+; Set 3D graphics mode
+Graphics3D 640,480,16,0
+
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/HWMultiTex.htm b/_release/help/commands/3d_commands/HWMultiTex.htm index d622581..483292c 100644 --- a/_release/help/commands/3d_commands/HWMultiTex.htm +++ b/_release/help/commands/3d_commands/HWMultiTex.htm @@ -1,48 +1,36 @@ -Command: HWMultiTex - - +Blitz3D Docs + - - -

  HWMultiTex enable  

- -

-Parameters:
-

- - - - +

HWMultiTex enable

+

Parameters

+
enable - true to enable hardware multitexturing, false to disable. Defaults to - true.
+ + +
+enable - True to enable hardware multitexturing, False to disable.
+
+The default HWMultiTex mode is True. +
-

Description:
-
- - - - +

Description

+
Enables or disables hardware multitexturing.
-
-Multitexturing is a technique used to display more than one texture on an object -at once. Sometimes, 3D hardware has built-in support for this, so that using two -textures or more per object will not be any slower than using just one.
-
-However, some cards have problems dealing with hardware multitexturing, and for -these situations you have the option of disabling it.
-
-When hardware texturing isn't being used, Blitz3D will use its own software -technique, which involves duplicating objects that just have one texture each.
+ + +
+Enables or disables hardware multitexturing.
+
+Multitexturing is a technique used to display more than one texture on an object at once. Sometimes, 3D hardware has built-in support for this, so that using two textures or more per object will not be any slower than using just one.
+
+However, some cards have problems dealing with hardware multitexturing, and for these situations you have the option of disabling it.
+
+When hardware texturing isn't being used, Blitz3D will use its own software technique, which involves duplicating objects that just have one texture each. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/HandleSprite.htm b/_release/help/commands/3d_commands/HandleSprite.htm index 7894a73..fadf3d3 100644 --- a/_release/help/commands/3d_commands/HandleSprite.htm +++ b/_release/help/commands/3d_commands/HandleSprite.htm @@ -1,39 +1,58 @@ -Command: HandleSprite - - +Blitz3D Docs + - - -

  HandleSprite sprite,x_handle#,y_handle#  

- -

-Parameters:
-

- - - - +

HandleSprite sprite,x_handle#,y_handle#

+

Parameters

+
sprite - sprite handle. Not to be confused with HandleSprite - ie. the - handle used to position the sprite, rather than the sprite's actual handle
+ + +
+sprite - sprite handle. Not to be confused with HandleSprite - ie. the handle used to position the sprite, rather than the sprite's actual handle +
-

Description:
-
- - - - +

Description

+
Sets a sprite handle. Defaults to 0,0,0.

A sprite extends from 1,-1 to - +1,+1.

+ + +
+Sets a sprite handle. Defaults to 0,0.
+
+A sprite extends from -1,-1 to +1,+1. +
+
+See also: LoadSprite, CreateSprite. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+cam = CreateCamera()
+MoveEntity cam,0,0,-5
+
+sp = CreateSprite()
+
+handlepos# = 0.0
+While Not KeyDown(1)
+RenderWorld
+Color 100,100,100
+Plot 320,240
+Text 320,250,"Handle",True
+Flip
+HandleSprite sp,handlepos,handlepos
+handlepos = handlepos + 0.01
+Wend
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/HideEntity.htm b/_release/help/commands/3d_commands/HideEntity.htm index b52f786..db0fafe 100644 --- a/_release/help/commands/3d_commands/HideEntity.htm +++ b/_release/help/commands/3d_commands/HideEntity.htm @@ -1,46 +1,34 @@ -Command: HideEntity - - +Blitz3D Docs + - - -

  HideEntity entity  

- -

-Parameters:
-

- - - - +

HideEntity entity

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Hides an entity, so that it is no longer visible, and is no longer - involved in collisions.

The main purpose of hide entity is to allow you to - create entities at the beginning of a program, hide them, then copy them and - show as necessary in the main game. This is more efficient than creating - entities mid-game.

-

If you wish to hide an entity so that it is no longer visible but still - involved in collisions, then use EntityAlpha 0 - instead. This will make an entity completely transparent.

HideEntity - affects the specified entity and all of its child entities, if any - exist.

+ + +
+Hides an entity, so that it is no longer visible, and is no longer involved in collisions.
+
+The main purpose of hide entity is to allow you to create entities at the beginning of a program, hide them, then copy them and show as necessary in the main game. This is more efficient than creating entities mid-game.
+
+If you wish to hide an entity so that it is no longer visible but still involved in collisions, then use EntityAlpha 0 instead. This will make an entity completely transparent.
+
+HideEntity affects the specified entity and all of its child entities, if any exist. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/LightColor.htm b/_release/help/commands/3d_commands/LightColor.htm index e23dca4..afb118e 100644 --- a/_release/help/commands/3d_commands/LightColor.htm +++ b/_release/help/commands/3d_commands/LightColor.htm @@ -1,46 +1,64 @@ -Command: LightColor - - +Blitz3D Docs + - - -

  LightColor light,red#,green#,blue#  

- -

-Parameters:
-

- - - - +

LightColor light,red#,green#,blue#

+

Parameters

+
light - light handle
- red# - red value of light
- green# - green value of light
- blue# - blue value of light
+ + +
+light - light handle
+red# - red value of light
+green# - green value of light
+blue# - blue value of light +
-

Description:
-
- - - - +

Description

+
Sets the color of a light.

An r,g,b value of 255,255,255 will brighten - anything the light shines on.
-
- An r,g,b value of 0,0,0 will have no affect on anything it shines on.
-
- An r,g,b value of -255,-255,-255 will darken anything it shines on. This is - known as 'negative lighting', and is useful for shadow effects.

+ + +
+Sets the color of a light.
+
+An r,g,b value of 255,255,255 will brighten anything the light shines on.
+
+An r,g,b value of 0,0,0 will have no affect on anything it shines on.
+
+An r,g,b value of -255,-255,-255 will darken anything it shines on. This is known as 'negative lighting', and is useful for shadow effects. +
+
+See also: CreateLight, LightRange, LightConeAngles. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+camera = CreateCamera()
+MoveEntity camera,0,0,-3
+
+ball = CreateSphere()
+
+lite = CreateLight() ; try different lights 1 to 3
+MoveEntity lite,5,0,-15
+PointEntity lite,ball
+
+
+While Not KeyDown(1)
+RenderWorld:Flip
+If KeyHit(57) Then LightColor lite,Rnd(255),Rnd(255),Rnd(255) ; press SPACEBAR to try different light colors
+Wend
+End +
-

Index

- - \ 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/LightConeAngles.htm b/_release/help/commands/3d_commands/LightConeAngles.htm index 485b2b6..e83e730 100644 --- a/_release/help/commands/3d_commands/LightConeAngles.htm +++ b/_release/help/commands/3d_commands/LightConeAngles.htm @@ -1,40 +1,60 @@ -Command: LightConeAngles - - +Blitz3D Docs + - - -

  LightConeAngles light,inner_angle#,outer_angle#  

- -

-Parameters:
-

- - - - +

LightConeAngles light,inner_angle#,outer_angle#

+

Parameters

+
light - light handle
- inner_angle# - inner angle of cone
- outer_angle# - outer angle of cone
+ + +
+light - light handle
+inner_angle# - inner angle of cone
+outer_angle# - outer angle of cone +
-

Description:
-
- - - - +

Description

+
Sets the 'cone' angle for a spotlight.

The default light cone angles - setting is 0,90.

+ + +
+Sets the 'cone' angle for a 'spot' light.
+
+The default light cone angles setting is 0,90. +
+
+See also: CreateLight, LightRange, LightColor. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+camera = CreateCamera()
+MoveEntity camera,0,0,-40
+
+flat = CreatePlane(10)
+TurnEntity flat,-90,0,0
+
+lite = CreateLight(3) ; try different lights 1 to 3
+MoveEntity lite,0,0,-15
+
+While Not KeyDown(1)
+RenderWorld:Flip
+If KeyHit(57) Then ; press SPACEBAR to randomly change the 'cone' of light
+LightConeAngles lite, Rand(120),Rand(120)
+EndIf
+Wend
+End +
-

Index

- - \ 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/LightMesh.htm b/_release/help/commands/3d_commands/LightMesh.htm index 82de610..0a6770d 100644 --- a/_release/help/commands/3d_commands/LightMesh.htm +++ b/_release/help/commands/3d_commands/LightMesh.htm @@ -1,44 +1,62 @@ -Command: LightMesh - - +Blitz3D Docs + - - -

  LightMesh mesh,red#,green#,blue#[,range#][,light_x#][,light_y#][,light_z#]  

- -

-Parameters:
-

- - - - +

LightMesh mesh,red#,green#,blue#[,range#][,light_x#][,light_y#][,light_z#]

+

Parameters

+
mesh - mesh handle
- red# - mesh red value
- green# - mesh green value
- blue# - mesh blue value
- range# (optional) - light range
- light_x# (optional) - light x position
- light_y# (optional) - light y position
- light_z# (optional) - light z position
+ + +
+mesh - mesh handle
+red# - mesh red value
+green# - mesh green value
+blue# - mesh blue value
+range# (optional) - light range
+light_x# (optional) - light x position
+light_y# (optional) - light y position
+light_z# (optional) - light z position +
-

Description:
-
- - - - +

Description

+
Performs a 'fake' lighting operation on a mesh.
+ + +
+Performs a 'fake' lighting operation on a mesh.
+
+You need to use EntityFX ent,2 to enable vertex colors on the target mesh before you can see any results.
+
+Since V1.83 the default vertex color for primitives is 255,255,255 and not 0,0,0, so for LightMesh to effect primitives as it did before, you will first need to reset the vertex colors to 0,0,0. You can do this using LightMesh mesh,-255,-255,-255. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480 ,16,2
+camera=CreateCamera()
+
+ent=CreateSphere()
+EntityFX ent,2 ; enable vertex colors
+Lightmesh ent,-255,-255,-255 ; reset vertex colors from 255,255,255 (default) to 0,0,0
+LightMesh ent,255,255,0,50,-20,20,-20 ; apply fake lighting
+
+MoveEntity camera,0,2,-10
+PointEntity camera,ent
+
+While Not KeyDown(1)
+RenderWorld
+Flip
+Wend
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LightRange.htm b/_release/help/commands/3d_commands/LightRange.htm index ed80739..03f3d0e 100644 --- a/_release/help/commands/3d_commands/LightRange.htm +++ b/_release/help/commands/3d_commands/LightRange.htm @@ -1,42 +1,65 @@ -Command: LightRange - - +Blitz3D Docs + - - -

  LightRange light,range#  

- -

-Parameters:
-

- - - - +

LightRange light,range#

+

Parameters

+
light - light handle
- range - range of light
+ + +
+light - light handle
+range# - range of light (default: 1000.0) +
-

Description:
-
- - - - +

Description

+
Sets the range of a light.

The range of a light is how far it reaches. - Everything outside the range of the light will not be affected by it.
-
- The value is very approximate, and should be experimented with for best - results.

+ + +
+Sets the range of a light.
+
+The range of a light is how far it reaches. Everything outside the range of the light will not be affected by it.
+
+The value is very approximate, and should be experimented with for best results. +
+
+See also: CreateLight, LightColor, LightConeAngles. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+camera = CreateCamera()
+MoveEntity camera,0,0,-3
+
+ball = CreateSphere()
+
+lite = CreateLight(2) ; try different lights 1 to 3
+MoveEntity lite,5,0,-5
+PointEntity lite,ball
+
+range# = 0.5
+LightRange lite,range
+
+While Not KeyDown(1)
+RenderWorld:Flip
+If KeyHit(57) Then ; hit SPACEBAR to increase light range
+range = range + 0.5
+LightRange lite,range
+EndIf
+Wend
+End +
-

Index

- - \ 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/LinePick.htm b/_release/help/commands/3d_commands/LinePick.htm index 6717518..8ad81cd 100644 --- a/_release/help/commands/3d_commands/LinePick.htm +++ b/_release/help/commands/3d_commands/LinePick.htm @@ -1,43 +1,37 @@ -Command: LinePick - - +Blitz3D Docs + - - -

  LinePick ( x#,y#,z#,dx#,dy#,dz#[,radius#] )  

- -

-Parameters:
-

- - - - +

LinePick ( x#,y#,z#,dx#,dy#,dz#[,radius#] )

+

Parameters

+
x# - x coordinate of start of line pick
- y# - y coordinate of start of line pick
- z# - z coordinate of start of line pick
- dx# - distance x of line pick
- dy# - distance y of line pick
- dz# - distance z of line pick
- radius (optional) - radius of line pick
+ + +
+x# - x coordinate of start of line pick
+y# - y coordinate of start of line pick
+z# - z coordinate of start of line pick
+dx# - distance x of line pick
+dy# - distance y of line pick
+dz# - distance z of line pick
+radius (optional) - radius of line pick +
-

Description:
-
- - - - +

Description

+
Returns the first entity between x,y,z to x+dx,y+dy,z+dz.
+ + +
+Returns the first entity between x,y,z to x+dx,y+dy,z+dz. +
+
+See also: EntityPick, LinePick, CameraPick, EntityPickMode. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/Load3DSound.htm b/_release/help/commands/3d_commands/Load3DSound.htm index fc039b9..2a7f46d 100644 --- a/_release/help/commands/3d_commands/Load3DSound.htm +++ b/_release/help/commands/3d_commands/Load3DSound.htm @@ -1,37 +1,79 @@ -Command: Load3DSound - - +Blitz3D Docs + - - -

  Load3DSound ( file$ )  

- -

-Parameters:
-

- - - - +

Load3DSound ( file$ )

+

Parameters

+
file$ - filename of sound file to be loaded and used as 3D sound
+ + +
+file$ - filename of sound file to be loaded and used as 3D sound +
-

Description:
-
- - - - +

Description

+
Loads a sound and returns its handle for use with EmitSound.
+ + +
+Loads a sound and returns its handle for use with EmitSound. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; Load3DSound 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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LoadAnimMesh.htm b/_release/help/commands/3d_commands/LoadAnimMesh.htm index 3f33e4e..6ba9526 100644 --- a/_release/help/commands/3d_commands/LoadAnimMesh.htm +++ b/_release/help/commands/3d_commands/LoadAnimMesh.htm @@ -1,40 +1,73 @@ -Command: LoadAnimMesh - - +Blitz3D Docs + - - -

  LoadAnimMesh ( file$[,parent] )  

- -

-Parameters:
-

- - - - +

LoadAnimMesh( Filename$, [Parent] )

+

Parameters

+
file$ - mesh filename
- parent - parent entity of mesh
+ + +
+Filename$ - Name of the file containing the model to load.
+Parent (optional) - Specify an entity to act as a Parent to the loaded mesh. +
-

Description:
-
- - - - +

Description

+
Loads a mesh from a .x or .3ds file and returns a mesh handle.

Any - hierarchy and animation information in the file is retained (if present in - the file!).

+ + +
+LoadAnimMesh, similar to LoadMesh, Loads a mesh from an .X, .3DS or .B3D file and returns a mesh handle.
+
+The difference between LoadMesh and LoadAnimMesh is that any hierarchy and animation information present in the file is retained. You can then either activate the animation by using the Animate command or find child entities within the hierarchy by using the FindChild(), GetChild() functions.
+
+The optional parent parameter allows you to specify a parent entity for the mesh so that when the parent is moved the child mesh 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 mesh being created at position 0,0,0 rather than at the parent entity's position. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; LoadAnimMesh Example
+; --------------------
+
+; In this example we will demonstrate the use of the LoadAnimMesh command.
+
+; Quite simply, we will load an anim mesh from file, animate it, and then view it.
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,20,-100 ; position camera so that robot will be in view when loaded
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load anim mesh
+robot=LoadAnimMesh("media/makbot/mak_robotic.3ds")
+
+; Animate mesh - this will begin an animation sequence which is updated when UpdateWorld is called
+Animate robot,2
+
+While Not KeyDown(1)
+
+UpdateWorld ; Update anim - without this our anim mesh will freeze
+RenderWorld ; Render everything
+Flip ; Show everything
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LoadAnimSeq.htm b/_release/help/commands/3d_commands/LoadAnimSeq.htm index 7f12277..1fe8f0e 100644 --- a/_release/help/commands/3d_commands/LoadAnimSeq.htm +++ b/_release/help/commands/3d_commands/LoadAnimSeq.htm @@ -1,39 +1,31 @@ -Command: LoadAnimSeq - - +Blitz3D Docs + - - -

  LoadAnimSeq ( entity,filename$ )  

- -

-Parameters:
-

- - - - +

LoadAnimSeq ( entity,filename$ )

+

Parameters

+
entity - entity handle
- filename$ - filename of animated 3D object
+ + +
+entity - entity handle
+filename$ - filename of animated 3D object +
-

Description:
-
- - - - +

Description

+
Appends an animation sequence from a file to an entity.

Returns the - animation sequence number added.

+ + +
+Appends an animation sequence from a file to an entity.
+
+Returns the animation sequence number added. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LoadAnimTexture.htm b/_release/help/commands/3d_commands/LoadAnimTexture.htm index 3be7e4c..ff9197c 100644 --- a/_release/help/commands/3d_commands/LoadAnimTexture.htm +++ b/_release/help/commands/3d_commands/LoadAnimTexture.htm @@ -1,53 +1,105 @@ -Command: LoadAnimTexture - - +Blitz3D Docs + - - -

  LoadAnimTexture ( -file$,flags,frame_width,frame_height,first_frame,frame_count )  

- -

-Parameters:
-

- - - - +

LoadAnimTexture ( file$,flags,frame_width,frame_height,first_frame,frame_count )

+

Parameters

+
file$ - name of file with animation frames laid out in left-right, - top-to-bottom order

flags - texture flag:
- 1: Color
- 2: Alpha
- 4: Masked
- 8: Mipmapped
- 16: Clamp U
- 32: Clamp V
- 64: Spherical reflection map
-
- frame_width - width of each animation frame
- frame_height - height of each animation frame
- first_frame - the first frame to be used as an animation frame.
- frame_count - the amount of frames to be used

+ + +
+file$ - name of image file with animation frames laid out in left-right, top-to-bottom order
+
+flags (optional) - texture flag:
+1: Color (default)
+2: Alpha
+4: Masked
+8: Mipmapped
+16: Clamp U
+32: Clamp V
+64: Spherical reflection map
+128: Cubic environment map
+256: Store texture in vram
+512: Force the use of high color textures
+
+frame_width - width of each animation frame
+frame_height - height of each animation frame
+first_frame - the first frame to be used as an animation frame
+frame_count - the amount of frames to be used +
-

Description:
-
- - - - +

Description

+
Loads a sequence of animation frames into a texture.

See also: - CreateTexture, - LoadTexture.

+ + +
+Loads an animated texture from an image file and returns the texture's handle.
+
+The 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 colour and alpha maps.
+
+See CreateTexture for more detailed descriptions of the texture flags.
+
+The frame_width, frame_height, first_frame and frame_count parameters determine how Blitz will separate the image file into individual animation frames. +
+
+See also: CreateTexture, LoadTexture. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; LoadAnimTexture Example
+; -----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load anim texture
+anim_tex=LoadAnimTexture( "media/boomstrip.bmp",49,64,64,0,39 )
+
+While Not KeyDown( 1 )
+
+; Cycle through anim frame values. 100 represents delay, 39 represents no. of anim frames
+frame=MilliSecs()/100 Mod 39
+
+; Texture cube with anim texture frame
+EntityTexture cube,anim_tex,frame
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/LoadBrush.htm b/_release/help/commands/3d_commands/LoadBrush.htm index 8f6405c..fd94f3b 100644 --- a/_release/help/commands/3d_commands/LoadBrush.htm +++ b/_release/help/commands/3d_commands/LoadBrush.htm @@ -1,50 +1,41 @@ -Command: LoadBrush - - +Blitz3D Docs + - - -

  LoadBrush ( file$[,flags][,u_scale][,v_scale]  

- -

-Parameters:
-

- - - - +

LoadBrush ( texture_file$[,flags][,u_scale][,v_scale]

+

Parameters

+
file$ - filename
- flags - brush flags
-
- flags (optional) - flags can be added to combine effects:
- 1: Color
- 2: Alpha
- 4: Masked
- 8: Mipmapped
- 16: Clamp U
- 32: Clamp V
- 64: Spherical reflection map
-
- u_scale - brush u_scale
- v_scale - brush v_scale
+ + +
+texture_file$ - filename of texture
+flags - brush flags
+
+flags (optional) - flags can be added to combine effects:
+1: Color
+2: Alpha
+4: Masked
+8: Mipmapped
+16: Clamp U
+32: Clamp V
+64: Spherical reflection map
+
+u_scale - brush u_scale
+v_scale - brush v_scale +
-

Description:
-
- - - - +

Description

+
Creates a brush, assigns a texture to it, and returns a brush handle.
+ + +
+Creates a brush, loads and assigns a texture to it, and returns a brush handle. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LoadMD2.htm b/_release/help/commands/3d_commands/LoadMD2.htm index 115d690..4f31edc 100644 --- a/_release/help/commands/3d_commands/LoadMD2.htm +++ b/_release/help/commands/3d_commands/LoadMD2.htm @@ -1,77 +1,73 @@ -Command: LoadMD2 - - +Blitz3D Docs + - - -

  LoadMD2 ( md2_file$[,parent] )  

- -

-Parameters:
-

- - - - +

LoadMD2 ( md2_file$[,parent] )

+

Parameters

+
md2_file$ - filename of md2
- parent (optional) - parent entity of md2
+ + +
+md2_file$ - filename of md2
+parent (optional) - parent entity of md2 +
-

Description:
-
- - - - +

Description

+
Loads an md2 entity and returns its handle.

An md2's texture has to be - loaded and applied to the md2 separately, otherwise the md2 will appear - untextured.

-

Md2's have their own set of animation commands, and will not work with - normal animation commands.

- -

The optional parent parameter allow you to specify a parent entity for - the md2 so that when the parent is moved the child md2 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 md2 being created at - position 0,0,0 rather than at the parent entity's position.

+ + +
+Loads an md2 entity and returns its handle.
+
+An md2's texture has to be loaded and applied to the md2 separately, otherwise the md2 will appear untextured.
+
+Md2's have their own set of animation commands, and will not work with normal animation commands.
+
+The optional parent parameter allows you to specify a parent entity for the md2 so that when the parent is moved the child md2 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 md2 being created at position 0,0,0 rather than at the parent entity's position. +
-

Example:
-
- - - - - +

Example

+
; LoadMD2 Example
- ; ---------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load md2
- gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" )
-
- ; Load md2 texture
- garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
-
- ; Apply md2 texture to md2
- EntityTexture gargoyle,garg_tex
-
- PositionEntity gargoyle,0,-45,100
- RotateEntity gargoyle,0,180,0
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; LoadMD2 Example
+; ---------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load md2
+gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" )
+
+; Load md2 texture
+garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
+
+; Apply md2 texture to md2
+EntityTexture gargoyle,garg_tex
+
+PositionEntity gargoyle,0,-45,100
+RotateEntity gargoyle,0,180,0
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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/LoadMesh.htm b/_release/help/commands/3d_commands/LoadMesh.htm index 1e23fce..10dd50b 100644 --- a/_release/help/commands/3d_commands/LoadMesh.htm +++ b/_release/help/commands/3d_commands/LoadMesh.htm @@ -1,68 +1,66 @@ -Command: LoadMesh - - +Blitz3D Docs + - - -

  LoadMesh ( file$[,parent] )  

- -

-Parameters:
-

- - - - +

LoadMesh(filename$,[Parent])

+

Parameters

+
file$ - filename of mesh
- parent (optional) - parent entity of mesh
+ + +
+Filename$ - Name of the file containing the model to load.
+Parent (optional) - Specify an entity to act as a Parent to the loaded mesh. +
-

Description:
-
- - - - +

Description

+
Loads a mesh from a .x or .3ds file and returns the mesh's handle.

Any - hierarchy and animation information in the file will be ignored. Use - LoadAnimMesh to maintain hierarchy and - animation information.

The optional parent parameter allow - you to specify a parent entity for the mesh so that when the parent is moved - the child mesh 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 mesh being created at - position 0,0,0 rather than at the parent entity's position.

-

See also: LoadAnimMesh.

+ + +
+LoadMesh, as the name suggests, Loads a mesh from an .X, .3DS or .B3D file (Usually created in advance by one of a number of 3D model creation packages) and returns the mesh handle.
+
+Any hierarchy and animation information in the file will be ignored. Use LoadAnimMesh to maintain hierarchy and animation information.
+
+The optional parent parameter allows you to specify a parent entity for the mesh so that when the parent is moved the child mesh 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 mesh being created at position 0,0,0 rather than at the parent entity's position.
+
+See also: LoadAnimMesh. +
-

Example:
-
- - - - - +

Example

+
; LoadMesh Example
- ; ----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load mesh
- drum=LoadMesh("media/oil-drum/oildrum.3ds")
-
- PositionEntity drum,0,0,MeshDepth(drum)*2
-
- While Not KeyDown( 1 )
- RenderWorld
- Flip
- Wend
-
- End
+ + +
+; LoadMesh Example
+; ----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load mesh
+drum=LoadMesh("media/oil-drum/oildrum.3ds")
+
+PositionEntity drum,0,0,MeshDepth(drum)*2
+
+While Not KeyDown( 1 )
+RenderWorld
+Flip
+Wend
+
+End +
-

Index

- - \ 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/LoadSprite.htm b/_release/help/commands/3d_commands/LoadSprite.htm index 97d5c0b..32aed32 100644 --- a/_release/help/commands/3d_commands/LoadSprite.htm +++ b/_release/help/commands/3d_commands/LoadSprite.htm @@ -1,51 +1,63 @@ -Command: LoadSprite - - +Blitz3D Docs + - - -

  LoadSprite ( tex_file$[,tex_flag][,parent] -)  

- -

-Parameters:
-

- - - - +

LoadSprite ( tex_file$[,tex_flag][,parent] )

+

Parameters

+
text_file$ - filename of image file to be used as sprite
-
- tex_flag (optional) - texture flag:
- 1: Color
- 2: Alpha
- 4: Masked
- 8: Mipmapped
- 16: Clamp U
- 32: Clamp V
- 64: Spherical reflection map
-
- parent - parent of entity
+ + +
+text_file$ - filename of image file to be used as sprite
+
+tex_flag (optional) - texture flag:
+1: Color
+2: Alpha
+4: Masked
+8: Mipmapped
+16: Clamp U
+32: Clamp V
+64: Spherical reflection map
+
+parent - parent of entity +
-

Description:
-
- - - - +

Description

+
Creates a sprite entity, and assigns a texture to it.

See also: - CreateSprite, - SpriteViewMode.

+ + +
+Creates a sprite entity, and assigns a texture to it. +
+
+See also: LoadSprite, RotateSprite, ScaleSprite, HandleSprite, SpriteViewMode, PositionEntity, MoveEntity, TranslateEntity, EntityAlpha, FreeEntity. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+campivot = CreatePivot()
+cam = CreateCamera(campivot)
+MoveEntity cam,0,0,-5
+
+sp = LoadSprite("grass.bmp")
+SpriteViewMode sp,4
+
+While Not KeyDown(1)
+RenderWorld:Flip
+TurnEntity campivot,1,1,3
+Wend
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LoadTerrain.htm b/_release/help/commands/3d_commands/LoadTerrain.htm index 6ae0a13..b0486f7 100644 --- a/_release/help/commands/3d_commands/LoadTerrain.htm +++ b/_release/help/commands/3d_commands/LoadTerrain.htm @@ -1,109 +1,104 @@ -Command: LoadTerrain - - +Blitz3D Docs + - - -

  LoadTerrain ( file$[,parent] )  

- -

-Parameters:
-

- - - - +

LoadTerrain ( file$[,parent] )

+

Parameters

+
file$ - filename of image file to be used as height map
- parent (optional) - parent entity of terrain
+ + +
+file$ - filename of image file to be used as height map
+parent (optional) - parent entity of terrain +
-

Description:
-
- - - - +

Description

+
Loads a terrain from an image file and returns the terrain's handle. The image's red channel is used to - determine heights. Terrain is initially the same width and depth as the - image, and 1 high.

Tips on generating nice terrain:
-
- * Smooth or blur the height map
- * Reduce the y scale of the terrain
- * Increase the x/z scale of the terrain
- * Reduce the camera range

-

When texturing an entity, a texture with a scale of 1,1,1 (default) will - be the same size as one of the terrain's grid squares. A texture that is - scaled to the same size as the size of the bitmap used to load it or the no. - of grid square used to create it, will be the same size as the terrain.

-

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.

-
-

See also: CreateTerrain.

+ + +
+Loads a terrain from an image file and returns the terrain's handle.
+
+The image's red channel is used to determine heights. Terrain is initially the same width and depth as the image, and 1 unit high.
+
+Tips on generating nice terrain:
+
+* Smooth or blur the height map
+* Reduce the y scale of the terrain
+* Increase the x/z scale of the terrain
+* Reduce the camera range
+
+When texturing an entity, a texture with a scale of 1,1,1 (default) will be the same size as one of the terrain's grid squares. A texture that is scaled to the same size as the size of the bitmap used to load it or the no. of grid square used to create it, will be the same size as the terrain.
+
+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.
+
+A heightmaps dimensions (width and height) must be the same and must be a power of 2, e.g. 32, 64, 128, 256, 512, 1024.
+
+See also: CreateTerrain. +
-

Example:
-
- - - - - +

Example

+
SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Set terrain detail, enable vertex morphing
- TerrainDetail terrain,4000,True
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- While Not KeyDown( 1 )
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)+5
-
- PositionEntity camera,x#,terra_y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
-
- Flip
-
- Wend
-
- End
+ + +
+LoadTerrain Example
+-------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Set terrain detail, enable vertex morphing
+TerrainDetail terrain,4000,True
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,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
+If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)+5
+
+PositionEntity camera,x#,terra_y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/LoadTexture.htm b/_release/help/commands/3d_commands/LoadTexture.htm index 6580a67..51661a9 100644 --- a/_release/help/commands/3d_commands/LoadTexture.htm +++ b/_release/help/commands/3d_commands/LoadTexture.htm @@ -1,114 +1,100 @@ -Command: LoadTexture - - +Blitz3D Docs + - - -

  LoadTexture ( file$[,flags] )  

- -

-Parameters:
-

- - - - +

LoadTexture ( file$[,flags] )

+

Parameters

+
file$ - filename of image file to be used as texture
-
- flags (optional) - texture flag:
- 1: Color
- 2: Alpha
- 4: Masked
- 8: Mipmapped
- 16: Clamp U
- 32: Clamp V
- 64: Spherical reflection map
+ + +
+file$ - filename of image file to be used as 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 +
-

Description:
-
- - - - +

Description

+
Load a texture from an image file and returns the texture's handle.
-
- 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 colour and alpha maps.

Here - are quick 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 - 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-ordinates. Prevents texture wrapping.
- 64: Spherical reflection map - environment mapping, for that shiny, teapot - look.
-
- Something to consider when applying texture flags to loaded textures is that - the texture may have already had certain flags applied to it via the - TextureFilter command. The default for the - TextureFilter command is 9 (1+8), which is a - coloured, mipmapped texture. This cannot be overridden via the flags - parameter of LoadTexture command - if you wish for the filters to be removed - you will need to use the - ClearTextureFilters command.

See also: CreateTexture, - LoadAnimTexture.

+ + +
+Load a texture from an image file and returns the texture's handle. Supported file formats include: BMP, PNG, TGA and JPG. Only PNG and TGA support alpha.
+
+
+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 colour and alpha maps.
+
+
+See CreateTexture for more detailed descriptions of the texture flags.
+
+
+Something to consider when applying texture flags to loaded textures is that the texture may have already had certain flags applied to it via the TextureFilter command. The default for the TextureFilter command is 9 (1+8), which is a coloured, mipmapped texture. This cannot be overridden via the flags parameter of the LoadTexture command - if you wish for the filters to be removed you will need to use the ClearTextureFilters command, which must be done after setting the graphics mode (setting the graphics mode restores the default texture filters). +
+
+See also: CreateTexture, LoadAnimTexture. +
-

Example:
-
- - - - - +

Example

+
; LoadTexture Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture("../media/b3dlogo.jpg")
-
- ; Texture cube with texture
- EntityTexture cube,tex
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; LoadTexture Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Texture cube with texture
+EntityTexture cube,tex
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/LoaderMatrix.htm b/_release/help/commands/3d_commands/LoaderMatrix.htm index a916bbb..2486ed5 100644 --- a/_release/help/commands/3d_commands/LoaderMatrix.htm +++ b/_release/help/commands/3d_commands/LoaderMatrix.htm @@ -1,54 +1,49 @@ -Command: LoadMatrix - - +Blitz3D Docs + - - -

  LoaderMatrix file_extension$,xx#,xy#,xz#,yx#,yy#,yz#,zx#,zy#,zz#  

- -

-Parameters:
-

- - - - +

LoaderMatrix file_extension$,xx#,xy#,xz#,yx#,yy#,yz#,zx#,zy#,zz#

+

Parameters

+
file extension$ - file extension of 3d file, e.g. ".x",".3ds"
- xx# - 1,1 element of 3x3 matrix
- xy# - 2,1 element of 3x3 matrix
- xz# - 3,1 element of 3x3 matrix
- yx# - 1,2 element of 3x3 matrix
- yy# - 2,2 element of 3x3 matrix
- yz# - 3,2 element of 3x3 matrix
- zx# - 1,3 element of 3x3 matrix
- zy# - 2,3 element of 3x3 matrix
- zz# - 3,3 element of 3x3 matrix
+ + +
+file extension$ - file extension of 3d file, e.g. ".x",".3ds"
+xx# - 1,1 element of 3x3 matrix
+xy# - 2,1 element of 3x3 matrix
+xz# - 3,1 element of 3x3 matrix
+yx# - 1,2 element of 3x3 matrix
+yy# - 2,2 element of 3x3 matrix
+yz# - 3,2 element of 3x3 matrix
+zx# - 1,3 element of 3x3 matrix
+zy# - 2,3 element of 3x3 matrix
+zz# - 3,3 element of 3x3 matrix +
-

Description:
-
- - - - +

Description

+
Sets a matrix for 3d files loaded with the specified file extension.

- This can be used to change coordinate systems when loading.

-

By default, the following loader matrices are used:

-

LoaderMatrix "x",1,0,0,0,1,0,0,0,1 ; no change in coord system
- LoaderMatrix "3ds",1,0,0,0,0,1,0,1,0 ; swap y/z axis'

-

You can use LoaderMatrix to flip meshes/animations if necessary, eg:

-

LoaderMatrix "x",-1,0,0,0,1,0,0,0,1 ; flip x-cords for ".x" files
- LoaderMatrix "3ds",-1,0,0,0,0,-1,0,1,0 ; swap y/z, negate x/z for ".3ds" - files

+ + +
+Sets a matrix for 3d files loaded with the specified file extension.
+
+This can be used to change coordinate systems when loading.
+
+By default, the following loader matrices are used:
+
+LoaderMatrix "x",1,0,0,0,1,0,0,0,1 ; no change in coord system
+LoaderMatrix "3ds",1,0,0,0,0,1,0,1,0 ; swap y/z axis'
+
+You can use LoaderMatrix to flip meshes/animations if necessary, eg:
+
+LoaderMatrix "x",-1,0,0,0,1,0,0,0,1 ; flip x-cords for ".x" files
+LoaderMatrix "3ds",-1,0,0,0,0,-1,0,1,0 ; swap y/z, negate x/z for ".3ds" files +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MD2AnimLength.htm b/_release/help/commands/3d_commands/MD2AnimLength.htm index 262b968..84d6fe5 100644 --- a/_release/help/commands/3d_commands/MD2AnimLength.htm +++ b/_release/help/commands/3d_commands/MD2AnimLength.htm @@ -1,75 +1,72 @@ -Command: MD2AnimLength - - +Blitz3D Docs + - - -

  MD2AnimLength ( md2 )  

- -

-Parameters:
-

- - - - +

MD2AnimLength ( md2 )

+

Parameters

+
md2 - md2 handle
+ + +
+md2 - md2 handle +
-

Description:
-
- - - - +

Description

+
Returns the animation length of an md2 model.

The animation length is - the total amount of animation frames that consist within the md2 file.

-

See also: LoadMD2, - AnimateMD2, - MD2AnimTime, MD2Animating.

+ + +
+Returns the animation length of an md2 model.
+
+The animation length is the total amount of animation frames that consist within the md2 file. +
-

Example:
-
- - - - - +

Example

+
; MD2AnimLength Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load md2
- gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2")
-
- ; Load md2 texture
- garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
-
- ; Apply md2 texture to md2
- EntityTexture gargoyle,garg_tex
-
- PositionEntity gargoyle,0,-45,100
- RotateEntity gargoyle,0,180,0
-
- While Not KeyDown( 1 )
-
- RenderWorld
-
- ; Output animation length to screen
- Text 0,0,"MD2AnimLength: "+MD2AnimLength( gargoyle )
-
- Flip
-
- Wend
-
- End
+ + +
+; MD2AnimLength Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load md2
+gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2")
+
+; Load md2 texture
+garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
+
+; Apply md2 texture to md2
+EntityTexture gargoyle,garg_tex
+
+PositionEntity gargoyle,0,-45,100
+RotateEntity gargoyle,0,180,0
+
+While Not KeyDown( 1 )
+
+RenderWorld
+
+; Output animation length to screen
+Text 0,0,"MD2AnimLength: "+MD2AnimLength( gargoyle )
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MD2AnimTime.htm b/_release/help/commands/3d_commands/MD2AnimTime.htm index 9e3e689..688e294 100644 --- a/_release/help/commands/3d_commands/MD2AnimTime.htm +++ b/_release/help/commands/3d_commands/MD2AnimTime.htm @@ -1,81 +1,76 @@ -Command: MD2AnimTime - - +Blitz3D Docs + - - -

  MD2AnimTime ( md2 )  

- -

-Parameters:
-

- - - - +

MD2AnimTime ( md2 )

+

Parameters

+
md2 - md2 handle
+ + +
+md2 - md2 handle +
-

Description:
-
- - - - +

Description

+
Returns the animation time of an md2 model.

The animation time is the - exact moment that the md2 is at with regards its frames of animation. For - example, if the md2 at a certain moment in time is moving between the third - and fourth frames, then MD2AnimTime will return a number in the region 3-4.

-

See also: LoadMD2, - AnimateMD2, - MD2AnimLength, MD2Animating.

+ + +
+Returns the animation time of an md2 model.
+
+The animation time is the exact moment that the md2 is at with regards its frames of animation. For example, if the md2 at a certain moment in time is moving between the third and fourth frames, then MD2AnimTime will return a number in the region 3-4. +
-

Example:
-
- - - - - +

Example

+
; MD2AnimTime Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load md2
- gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2")
-
- ; Load md2 texture
- garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
-
- ; Apply md2 texture to md2
- EntityTexture gargoyle,garg_tex
-
- ; Animate md2
- AnimateMD2 gargoyle,1,0.1,32,46
-
- PositionEntity gargoyle,0,-45,100
- RotateEntity gargoyle,0,180,0
-
- While Not KeyDown( 1 )
-
- UpdateWorld
- RenderWorld
-
- ; Output current animation frame to screen
- Text 0,0,"MD2AnimTime: "+MD2AnimTime( gargoyle )
-
- Flip
-
- Wend
-
- End
+ + +
+; MD2AnimTime Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load md2
+gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2")
+
+; Load md2 texture
+garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
+
+; Apply md2 texture to md2
+EntityTexture gargoyle,garg_tex
+
+; Animate md2
+AnimateMD2 gargoyle,1,0.1,32,46
+
+PositionEntity gargoyle,0,-45,100
+RotateEntity gargoyle,0,180,0
+
+While Not KeyDown( 1 )
+
+UpdateWorld
+RenderWorld
+
+; Output current animation frame to screen
+Text 0,0,"MD2AnimTime: "+MD2AnimTime( gargoyle )
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MD2Animating.htm b/_release/help/commands/3d_commands/MD2Animating.htm index 827c936..a919812 100644 --- a/_release/help/commands/3d_commands/MD2Animating.htm +++ b/_release/help/commands/3d_commands/MD2Animating.htm @@ -1,79 +1,76 @@ -Command: MD2Animating - - +Blitz3D Docs + - - -

  MD2Animating ( md2 )  

- -

-Parameters:
-

- - - - +

MD2Animating ( md2 )

+

Parameters

+
md2 - md2 handle
+ + +
+md2 - md2 handle +
-

Description:
-
- - - - +

Description

+
Returns 1 (true) if md2 is currently animating, 0 (false) if not.

See also: LoadMD2, - AnimateMD2, - MD2AnimTime, MD2AnimLength.

+ + +
+Returns 1 (True) if md2 is currently animating, 0 (False) if not. +
-

Example:
-
- - - - - +

Example

+
; MD2Animating Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load md2
- gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2")
-
- ; Load md2 texture
- garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
-
- ; Apply md2 texture to md2
- EntityTexture gargoyle,garg_tex
-
- PositionEntity gargoyle,0,-45,100
- RotateEntity gargoyle,0,180,0
-
- While Not KeyDown( 1 )
-
- ; Toggle animation stop/start when spacebar pressed
- If KeyHit( 57 )=True start=1-start : AnimateMD2 gargoyle,start,0.1,32,46
-
- UpdateWorld
- RenderWorld
-
- Text 0,0,"Press spacebar to stop/start md2 animation"
-
- ; Output current md2 animation status to screen
- Text 0,20,"MD2Animating: "+MD2Animating( gargoyle )
-
- Flip
-
- Wend
-
- End
+ + +
+; MD2Animating Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load md2
+gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2")
+
+; Load md2 texture
+garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
+
+; Apply md2 texture to md2
+EntityTexture gargoyle,garg_tex
+
+PositionEntity gargoyle,0,-45,100
+RotateEntity gargoyle,0,180,0
+
+While Not KeyDown( 1 )
+
+; Toggle animation stop/start when spacebar pressed
+If KeyHit( 57 )=True start=1-start : AnimateMD2 gargoyle,start,0.1,32,46
+
+UpdateWorld
+RenderWorld
+
+Text 0,0,"Press spacebar to stop/start md2 animation"
+
+; Output current md2 animation status to screen
+Text 0,20,"MD2Animating: "+MD2Animating( gargoyle )
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MeshDepth.htm b/_release/help/commands/3d_commands/MeshDepth.htm index 75f6de0..26c03eb 100644 --- a/_release/help/commands/3d_commands/MeshDepth.htm +++ b/_release/help/commands/3d_commands/MeshDepth.htm @@ -1,38 +1,31 @@ -Command: MeshDepth - - +Blitz3D Docs + - - -

  MeshDepth# (mesh)  

- -

-Parameters:
-

- - - - +

MeshDepth# (mesh)

+

Parameters

+
mesh - mesh handle
+ + +
+mesh - mesh handle +
-

Description:
-
- - - - +

Description

+
Returns the depth of a mesh.

See also: - MeshWidth, MeshHeight.

+ + +
+Returns the depth of a mesh. This is calculated by the actual vertex positions and so the scale of the entity (set by ScaleEntity) will not have an effect on the resultant depth. Mesh operations, on the other hand, will effect the result. +
+
+See also: MeshWidth, MeshHeight. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MeshHeight.htm b/_release/help/commands/3d_commands/MeshHeight.htm index 9cb3302..09ec6e1 100644 --- a/_release/help/commands/3d_commands/MeshHeight.htm +++ b/_release/help/commands/3d_commands/MeshHeight.htm @@ -1,38 +1,31 @@ -Command: MeshHeight - - +Blitz3D Docs + - - -

  MeshHeight# (mesh )  

- -

-Parameters:
-

- - - - +

MeshHeight# (mesh )

+

Parameters

+
mesh - mesh handle
+ + +
+mesh - mesh handle +
-

Description:
-
- - - - +

Description

+
Returns the height of a mesh.

See also: - MeshWidth, MeshDepth.

+ + +
+Returns the height of a mesh. This is calculated by the actual vertex positions and so the scale of the entity (set by ScaleEntity) will not have an effect on the resultant height. Mesh operations, on the other hand, will effect the result. +
+
+See also: MeshWidth, MeshDepth. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MeshWidth.htm b/_release/help/commands/3d_commands/MeshWidth.htm index 4b7493a..aa5d372 100644 --- a/_release/help/commands/3d_commands/MeshWidth.htm +++ b/_release/help/commands/3d_commands/MeshWidth.htm @@ -1,38 +1,31 @@ -Command: MeshWidth - - +Blitz3D Docs + - - -

  MeshWidth# (mesh)  

- -

-Parameters:
-

- - - - +

MeshWidth# (mesh)

+

Parameters

+
mesh - mesh handle
+ + +
+mesh - mesh handle +
-

Description:
-
- - - - +

Description

+
Returns the width of a mesh.

See also: - MeshHeight, MeshDepth.

+ + +
+Returns the width of a mesh. This is calculated by the actual vertex positions and so the scale of the entity (set by ScaleEntity) will not have an effect on the resultant width. Mesh operations, on the other hand, will effect the result. +
+
+See also: MeshHeight, MeshDepth. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MeshesIntersect.htm b/_release/help/commands/3d_commands/MeshesIntersect.htm index 62c35a3..a155f8d 100644 --- a/_release/help/commands/3d_commands/MeshesIntersect.htm +++ b/_release/help/commands/3d_commands/MeshesIntersect.htm @@ -1,73 +1,72 @@ -Command: MeshIntersect - - +Blitz3D Docs + - - -

  MeshesIntersect (mesh_a,mesh_b )  

- -

-Parameters:
-

- - - - +

MeshesIntersect (mesh_a,mesh_b )

+

Parameters

+
mesh_a - mesh_a handle
- mesh_b - mesh_b handle
+ + +
+mesh_a - mesh_a handle
+mesh_b - mesh_b handle +
-

Description:
-
- - - - +

Description

+
Returns true if the specified meshes are currently intersecting.

This - is a fairly slow routine - use with discretion...

This command is - currently the only - polygon->polygon collision checking routine available in Blitz3D.

+ + +
+Returns true if the specified meshes are currently intersecting.
+
+This is a fairly slow routine - use with discretion...
+
+This command is currently the only polygon->polygon collision checking routine available in Blitz3D. +
-

Example:
-
- - - - - +

Example

+
; MeshesIntersect Example
- ; -----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- drum=LoadMesh("media/oil-drum/oildrum.3ds")
- PositionEntity drum,-20,0,100
-
- crate=LoadMesh("media/wood-crate/wcrate1.3ds")
- PositionEntity crate,20,0,100
-
- While Not KeyDown( 1 )
-
- TurnEntity drum,1,1,1
- TurnEntity crate,-1,-1,-1
-
- RenderWorld
-
- ; Test to see if drum and crate meshes are intersecting; if so then display - message to confirm this
- If MeshesIntersect(drum,crate)=True Then Text 0,0,"Meshes are intersecting!"
-
- Flip
-
- Wend
-
- End
+ + +
+; MeshesIntersect Example
+; -----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+drum=LoadMesh("media/oil-drum/oildrum.3ds")
+PositionEntity drum,-20,0,100
+
+crate=LoadMesh("media/wood-crate/wcrate1.3ds")
+PositionEntity crate,20,0,100
+
+While Not KeyDown( 1 )
+
+TurnEntity drum,1,1,1
+TurnEntity crate,-1,-1,-1
+
+RenderWorld
+
+; Test to see if drum and crate meshes are intersecting; if so then display message to confirm this
+If MeshesIntersect(drum,crate)=True Then Text 0,0,"Meshes are intersecting!"
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ModifyTerrain.htm b/_release/help/commands/3d_commands/ModifyTerrain.htm index 1c6b2d5..97cb2a7 100644 --- a/_release/help/commands/3d_commands/ModifyTerrain.htm +++ b/_release/help/commands/3d_commands/ModifyTerrain.htm @@ -1,43 +1,109 @@ -Command: ModifyTerrain - - +Blitz3D Docs + - - -

  ModifyTerrain terrain,grid_x,grid_z,height#[,realtime]  

- -

-Parameters:
-

- - - - +

ModifyTerrain terrain,grid_x,grid_z,height#[,realtime]

+

Parameters

+
terrain - terrain handle
- grid_x - grid x coordinate of terrain
- grid_y - grid y coordinate of terrain
- height# - height of point on terrain. Should be in the range 0-1.
- realtime (optional) - true to modify terrain immediately. False to modify - terrain when RenderWorld in next called. - Defaults to false.
+ + +
+terrain - terrain handle
+grid_x - grid x coordinate of terrain
+grid_y - grid y coordinate of terrain
+height# - height of point on terrain. Should be in the range 0-1.
+realtime (optional) - True to modify terrain immediately. False to modify terrain when RenderWorld in next called. Defaults to False. +
-

Description:
-
- - - - +

Description

+
Sets the height of a point on a terrain.
+ + +
+Sets the height of a point on a terrain. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; ModifyTerrain Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+terra_size=32 ; initial size of terrain, and no. of grids segments, along each side
+x_scale=10 ; x scale of terrain
+y_scale=50 ; y scale of terrain
+z_scale=10 ; z scale of terrain
+marker_x=terra_size/2 ; initial x position of marker
+marker_z=terra_size/2 ; initial z position of marker
+
+camera=CreateCamera()
+PositionEntity camera,(terra_size*x_scale)/2,50,0 ; position wherever; just try and get good view of terrain!
+RotateEntity camera,30,0,0 ; again, try and get good view of terrain
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create terrain
+terra=CreateTerrain(terra_size)
+ScaleEntity terra,x_scale,y_scale,z_scale
+
+; Texture terrain
+grass_tex=LoadTexture("media/mossyground.bmp")
+EntityTexture terra,grass_tex
+
+; Create marker
+marker=CreateSphere()
+ScaleEntity marker,1,1,1
+EntityColor marker,255,0,0
+
+While Not KeyDown(1)
+
+; Change marker position values depending on cursor key pressed
+If KeyHit(205)=True Then marker_x=marker_x+1
+If KeyHit(203)=True Then marker_x=marker_x-1
+If KeyHit(208)=True Then marker_z=marker_z-1
+If KeyHit(200)=True Then marker_z=marker_z+1
+
+; Get terrain height at marker position
+marker_y#=TerrainHeight(terra,marker_x,marker_z)
+
+; If A pressed then increase marker_y value and modify terrain
+If KeyDown(30)=True
+If marker_y#<1 Then marker_y#=marker_y#+0.005
+ModifyTerrain terra,marker_x,marker_z,marker_y#
+EndIf
+
+; If Z pressed then decrease marker_y value and modify terrain
+If KeyDown(44)=True
+If marker_y#>0 Then marker_y#=marker_y#-0.005
+ModifyTerrain terra,marker_x,marker_z,marker_y#
+EndIf
+
+; Position marker, taking into account x, y and z scales of terrain
+PositionEntity marker,marker_x*x_scale,marker_y#*y_scale,marker_z*z_scale
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move marker over the terrain"
+Text 0,20,"Press A or Z to alter height of terrain at marker's position"
+Text 0,40,"Terrain Height: "+marker_y#
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/MoveEntity.htm b/_release/help/commands/3d_commands/MoveEntity.htm index 0a522a9..f601fa4 100644 --- a/_release/help/commands/3d_commands/MoveEntity.htm +++ b/_release/help/commands/3d_commands/MoveEntity.htm @@ -1,96 +1,90 @@ -Command: MoveEntity - - +Blitz3D Docs + - - -

  MoveEntity entity,x#,y#,z#  

- -

-Parameters:
-

- - - - +

MoveEntity entity,x#,y#,z#

+

Parameters

+
entity - name of entity to be moved
-x# - x amount that entity will be moved by
-y# - y amount that entity will be moved by
-z# - z amount that entity will be moved by
+ + +
+entity - name of entity to be moved
+x# - x amount that entity will be moved by
+y# - y amount that entity will be moved by
+z# - z amount that entity will be moved by +
-

Description:
-
- - -
Moves an entity relative to its current position and orientation.
+

Description

+ + + - +
+See also: TranslateEntity, PositionEntity, PositionMesh. + +
+Moves an entity relative to its current position and orientation.
+
+What this means is that an entity will move in whatever direction it is facing. So for example if you have an game character is upright when first loaded into Blitz3D and it remains upright (i.e. turns left or right only), then moving it by a z amount will always see it move forward or backward, moving it by a y amount will always see it move up or down, and moving it by an x amount will always see it strafe.
-What this means is that an entity will move in whatever direction it is facing. -So for example if you have an game character is upright when first loaded into -Blitz3D and it remains upright (i.e. turns left or right only), then moving it by -a z amount will always see it move forward or backward, moving it by a y amount -will always see it move up or down, and moving it by an x -amount will always see it strafe.

See also: - TranslateEntity, PositionEntity.

-

Example:
-
- - - - - +

Example

+
; MoveEntity Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
-
- ; Move cone in front of camera, so we can see it to begin with
- MoveEntity cone,0,0,10
-
- While Not KeyDown( 1 )
-
- ; Reset movement values - otherwise, the cone will not stop!
- x#=0
- y#=0
- z#=0
-
- ; Change rotation values depending on the key pressed
- If KeyDown( 203 )=True Then x#=-0.1
- If KeyDown( 205 )=True Then x#=0.1
- If KeyDown( 208 )=True Then y#=-0.1
- If KeyDown( 200 )=True Then y#=0.1
- If KeyDown( 44 )=True Then z#=-0.1
- If KeyDown( 30 )=True Then z#=0.1
-
- ; Move cone using movement values
- MoveEntity cone,x#,y#,z#
-
- ; If spacebar pressed then rotate cone by random amount
- If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( - 0,360 )
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to move cone, spacebar to rotate cone by random - amount"
- Text 0,20,"X Movement: "+x#
- Text 0,40,"Y Movement: "+y#
- Text 0,60,"Z Movement: "+z#
-
- Flip
-
- Wend
-
- End
+ + +
+; MoveEntity Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+
+; Move cone in front of camera, so we can see it to begin with
+MoveEntity cone,0,0,10
+
+While Not KeyDown( 1 )
+
+; Reset movement values - otherwise, the cone will not stop!
+x#=0
+y#=0
+z#=0
+
+; Change rotation values depending on the key pressed
+If KeyDown( 203 )=True Then x#=-0.1
+If KeyDown( 205 )=True Then x#=0.1
+If KeyDown( 208 )=True Then y#=-0.1
+If KeyDown( 200 )=True Then y#=0.1
+If KeyDown( 44 )=True Then z#=-0.1
+If KeyDown( 30 )=True Then z#=0.1
+
+; Move cone using movement values
+MoveEntity cone,x#,y#,z#
+
+; If spacebar pressed then rotate cone by random amount
+If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 )
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to move cone, spacebar to rotate cone by random amount"
+Text 0,20,"X Movement: "+x#
+Text 0,40,"Y Movement: "+y#
+Text 0,60,"Z Movement: "+z#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/NameEntity.htm b/_release/help/commands/3d_commands/NameEntity.htm index 0dc59ba..0b95a05 100644 --- a/_release/help/commands/3d_commands/NameEntity.htm +++ b/_release/help/commands/3d_commands/NameEntity.htm @@ -1,38 +1,32 @@ -Command: NameEntity - - +Blitz3D Docs + - - -

  NameEntity entity,name$  

- -

-Parameters:
-

- - - - +

NameEntity entity,name$

+

Parameters

+
entity - entity handle
- name$ - name of entity
+ + +
+entity - entity handle
+name$ - name of entity +
-

Description:
-
- - - - +

Description

+
Sets an entity's name.
+ + +
+Sets an entity's name. +
+
+See also: EntityName. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PaintEntity.htm b/_release/help/commands/3d_commands/PaintEntity.htm index c17c7b1..9e52938 100644 --- a/_release/help/commands/3d_commands/PaintEntity.htm +++ b/_release/help/commands/3d_commands/PaintEntity.htm @@ -1,41 +1,31 @@ -Command: PaintEntity - - +Blitz3D Docs + - - -

  PaintEntity entity,brush  

- -

-Parameters:
-

- - - - +

PaintEntity entity,brush

+

Parameters

+
entity - entity handle
- brush - brush handle
+ + +
+entity - entity handle
+brush - brush handle +
-

Description:
-
- - - - +

Description

+
Paints a entity with a brush.

The reason for using PaintEntity to apply - specific properties to a entity using a brush rather than just using EntityTexture, EntityColor, EntityShininess etc, is that you can pre-define - one brush, and then paint entities over and over again using just the one - command rather than lots of separate ones.

+ + +
+Paints a entity with a brush.
+
+The reason for using PaintEntity to apply specific properties to a entity using a brush rather than just using EntityTexture, EntityColor, EntityShininess etc, is that you can pre-define one brush, and then paint entities over and over again using just the one command rather than lots of separate ones. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PaintMesh.htm b/_release/help/commands/3d_commands/PaintMesh.htm index ccae9f6..9e03b48 100644 --- a/_release/help/commands/3d_commands/PaintMesh.htm +++ b/_release/help/commands/3d_commands/PaintMesh.htm @@ -1,97 +1,93 @@ -Command: PaintMesh - - +Blitz3D Docs + - - -

  PaintMesh mesh,brush  

- -

-Parameters:
-

- - - - +

PaintMesh mesh,brush

+

Parameters

+
mesh - mesh handle
- brush - brush handle
+ + +
+mesh - mesh handle
+brush - brush handle +
-

Description:
-
- - - - +

Description

+
Paints a mesh with a brush.

This has the - effect of instantly altering the visible appearance of the mesh, assuming the brush's properties are different - to what was was applied to the surface before.

-

The reason for using PaintMesh to apply - specific properties to a mesh using a brush rather than just using - EntityTexture, EntityColor, EntityShininess etc, is that you can pre-define - one brush, and then paint meshes over and over again using just the one - command rather than lots of separate ones.

See also: - PaintEntity, - PaintSurface.

+ + +
+Paints a mesh with a brush.
+
+This has the effect of instantly altering the visible appearance of the mesh, assuming the brush's properties are different to what was was applied to the surface before.
+
+The reason for using PaintMesh to apply specific properties to a mesh using a brush rather than just using EntityTexture, EntityColor, EntityShininess etc, is that you can pre-define one brush, and then paint meshes over and over again using just the one command rather than lots of separate ones.
+
+See also: PaintEntity, PaintSurface. +
-

Example:
-
- - - - - +

Example

+
; PaintMesh Example
- ; -----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture("../media/b3dlogo.jpg")
-
- ; Create brush
- brush=CreateBrush()
-
- ; Apply texture to brush
- BrushTexture brush,tex
-
- ; And some other effects
- BrushColor brush,0,0,255
- BrushShininess brush,1
-
- ; Paint mesh with brush
- PaintMesh cube,brush
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; PaintMesh Example
+; -----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture("media/b3dlogo.jpg")
+
+; Create brush
+brush=CreateBrush()
+
+; Apply texture to brush
+BrushTexture brush,tex
+
+; And some other effects
+BrushColor brush,0,0,255
+BrushShininess brush,1
+
+; Paint mesh with brush
+PaintMesh cube,brush
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PaintSurface.htm b/_release/help/commands/3d_commands/PaintSurface.htm index dce29fb..2a8ab6c 100644 --- a/_release/help/commands/3d_commands/PaintSurface.htm +++ b/_release/help/commands/3d_commands/PaintSurface.htm @@ -1,43 +1,33 @@ -Command: PaintSurface - - +Blitz3D Docs + - - -

  PaintSurface surface,brush  

- -

-Parameters:
-

- - - - +

PaintSurface surface,brush

+

Parameters

+
surface - surface handle
- brush - brush handle
+ + +
+surface - surface handle
+brush - brush handle +
-

Description:
-
- - - - +

Description

+
Paints a surface with a brush.

This has the - effect of instantly altering the visible appearance of that particular - surface, i.e. section of mesh, assuming the brush's properties are different - to what was was applied to the surface before.

-

See also: PaintEntity, - PaintMesh.

+ + +
+Paints a surface with a brush.
+
+This has the effect of instantly altering the visible appearance of that particular surface, i.e. section of mesh, assuming the brush's properties are different to what was applied to the surface before.
+
+See also: PaintEntity, PaintMesh. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PickedEntity.htm b/_release/help/commands/3d_commands/PickedEntity.htm index f5b6b15..04361d5 100644 --- a/_release/help/commands/3d_commands/PickedEntity.htm +++ b/_release/help/commands/3d_commands/PickedEntity.htm @@ -1,37 +1,91 @@ -Command: PickedEntity - - +Blitz3D Docs + - - -

  PickedEntity  

- -

-Parameters:
-

- - - - +

PickedEntity ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the entity 'picked' by the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick.
+
+Returns 0 if no entity was picked. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedEntity Example
+; --------------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedNX.htm b/_release/help/commands/3d_commands/PickedNX.htm index 26f7383..4b7402a 100644 --- a/_release/help/commands/3d_commands/PickedNX.htm +++ b/_release/help/commands/3d_commands/PickedNX.htm @@ -1,37 +1,89 @@ -Command: PickedNX - - +Blitz3D Docs + - - -

  PickedNX  

- -

-Parameters:
-

- - - - +

PickedNX ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the x component of the normal of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedNX Example
+; ----------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedNY.htm b/_release/help/commands/3d_commands/PickedNY.htm index 718119e..29c2ac5 100644 --- a/_release/help/commands/3d_commands/PickedNY.htm +++ b/_release/help/commands/3d_commands/PickedNY.htm @@ -1,37 +1,89 @@ -Command: PickedNY - - +Blitz3D Docs + - - -

  PickedNY  

- -

-Parameters:
-

- - - - +

PickedNY ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the y component of the normal of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedNY Example
+; ----------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedNZ.htm b/_release/help/commands/3d_commands/PickedNZ.htm index be84bb5..5cf8dca 100644 --- a/_release/help/commands/3d_commands/PickedNZ.htm +++ b/_release/help/commands/3d_commands/PickedNZ.htm @@ -1,37 +1,89 @@ -Command: PickedNZ - - +Blitz3D Docs + - - -

  PickedNZ  

- -

-Parameters:
-

- - - - +

PickedNZ ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the z component of the normal of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedNZ Example
+; ----------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedSurface.htm b/_release/help/commands/3d_commands/PickedSurface.htm index 37007bf..54b6401 100644 --- a/_release/help/commands/3d_commands/PickedSurface.htm +++ b/_release/help/commands/3d_commands/PickedSurface.htm @@ -1,37 +1,89 @@ -Command: PickedSurface - - +Blitz3D Docs + - - -

  PickedSurface  

- -

-Parameters:
-

- - - - +

PickedSurface ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the handle of the surface that was 'picked' by the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedSurface Example
+; ---------------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedTime.htm b/_release/help/commands/3d_commands/PickedTime.htm index ccd66a7..7674c3a 100644 --- a/_release/help/commands/3d_commands/PickedTime.htm +++ b/_release/help/commands/3d_commands/PickedTime.htm @@ -1,37 +1,89 @@ -Command: PickedTime - - +Blitz3D Docs + - - -

  PickedTime  

- -

-Parameters:
-

- - - - +

PickedTime ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the time taken to calculate the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedTime Example
+; ------------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedTriangle.htm b/_release/help/commands/3d_commands/PickedTriangle.htm index 5d9f0f0..750109a 100644 --- a/_release/help/commands/3d_commands/PickedTriangle.htm +++ b/_release/help/commands/3d_commands/PickedTriangle.htm @@ -1,37 +1,89 @@ -Command: PickedTriangle - - +Blitz3D Docs + - - -

  PickedTriangle  

- -

-Parameters:
-

- - - - +

PickedTriangle ( )

+

Parameters

+
<param description>
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Returns the index number of the triangle that was 'picked' by the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; PickedTriangle Example
+; ----------------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PickedX.htm b/_release/help/commands/3d_commands/PickedX.htm index adbb472..4f73266 100644 --- a/_release/help/commands/3d_commands/PickedX.htm +++ b/_release/help/commands/3d_commands/PickedX.htm @@ -1,42 +1,93 @@ -Command: PickedX - - +Blitz3D Docs + - - -

  PickedX# ( )  

- -

-Parameters:
-

- - - - +

PickedX# ( )

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Returns the world x coordinate of the most recently executed Pick - command. This might have been CameraPick, - EntityPick or LinePick.

- The coordinate represents the exact point of where something was picked.

-

See also: - PickedY, PickedZ.

+ + +
+Returns the world x coordinate of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick.
+
+The coordinate represents the exact point of where something was picked.
+
+See also: PickedY, PickedZ. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; PickedX Example
+; ---------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PickedY.htm b/_release/help/commands/3d_commands/PickedY.htm index 9018c31..8f59661 100644 --- a/_release/help/commands/3d_commands/PickedY.htm +++ b/_release/help/commands/3d_commands/PickedY.htm @@ -1,42 +1,93 @@ -Command: PickedY - - +Blitz3D Docs + - - -

  PickedY# ( )  

- -

-Parameters:
-

- - - - +

PickedY# ( )

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Returns the world y coordinate of the most recently executed Pick - command. This might have been CameraPick, - EntityPick or LinePick.

- The coordinate represents the exact point of where something was picked.

-

See also: - PickedX, PickedZ.

+ + +
+Returns the world y coordinate of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick.
+
+The coordinate represents the exact point of where something was picked.
+
+See also: PickedX, PickedZ. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; PickedY Example
+; ---------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PickedZ.htm b/_release/help/commands/3d_commands/PickedZ.htm index 99b2312..813ec82 100644 --- a/_release/help/commands/3d_commands/PickedZ.htm +++ b/_release/help/commands/3d_commands/PickedZ.htm @@ -1,42 +1,93 @@ -Command: PickedZ - - +Blitz3D Docs + - - -

  PickedZ# ( )  

- -

-Parameters:
-

- - - - +

PickedZ# ( )

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Returns the world z coordinate of the most recently executed Pick - command. This might have been CameraPick, - EntityPick or LinePick.

- The coordinate represents the exact point of where something was picked.

-

See also: - PickedX, PickedY.

+ + +
+Returns the world z coordinate of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick.
+
+The coordinate represents the exact point of where something was picked.
+
+See also: PickedX, PickedY. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; PickedZ Example
+; ---------------
+
+Graphics3D 640,480,0,2
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,0,2,-10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+cube=CreateCube()
+EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
+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
+
+; If left mouse button hit then use CameraPick with mouse coordinates
+; In this example, only three things can be picked: the plane, the cube, or nothing
+If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about"
+Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
+Text 0,40,"PickedX: "+PickedX#()
+Text 0,60,"PickedY: "+PickedY#()
+Text 0,80,"PickedZ: "+PickedZ#()
+Text 0,100,"PickedNX: "+PickedNX#()
+Text 0,120,"PickedNY: "+PickedNY#()
+Text 0,140,"PickedNZ: "+PickedNZ#()
+Text 0,160,"PickedTime: "+PickedTime#()
+Text 0,180,"PickedEntity: "+PickedEntity()
+Text 0,200,"PickedSurface: "+PickedSurface()
+Text 0,220,"PickedTriangle: "+PickedTriangle()
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PointEntity.htm b/_release/help/commands/3d_commands/PointEntity.htm index ef408f1..89b63da 100644 --- a/_release/help/commands/3d_commands/PointEntity.htm +++ b/_release/help/commands/3d_commands/PointEntity.htm @@ -1,44 +1,34 @@ -Command: PointEntity - - +Blitz3D Docs + - - -

  PointEntity entity,target[,roll#]  

- -

-Parameters:
-

- - - - +

PointEntity entity,target[,roll#]

+

Parameters

+
entity - entity handle
- target - target entity handle
- roll# (optional) - roll angle of entity
+ + +
+entity - entity handle
+target - target entity handle
+roll# (optional) - roll angle of entity +
-

Description:
-
- - - - +

Description

+
Points one entity at another.

The optional roll parameter allows you - to specify a roll angle as pointing an entity only sets pitch and yaw - angles.

-

If you wish for an entity to point at a certain position rather than - another entity, simply create a pivot entity at your desired position, point - the entity at this and then free the pivot.

+ + +
+Points one entity at another.
+
+The optional roll parameter allows you to specify a roll angle as pointing an entity only sets pitch and yaw angles.
+
+If you wish for an entity to point at a certain position rather than another entity, simply create a pivot entity at your desired position, point the entity at this and then free the pivot. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PositionEntity.htm b/_release/help/commands/3d_commands/PositionEntity.htm index 145d7ea..436047c 100644 --- a/_release/help/commands/3d_commands/PositionEntity.htm +++ b/_release/help/commands/3d_commands/PositionEntity.htm @@ -1,96 +1,87 @@ -Command: PositionEntity - - +Blitz3D Docs + - - -

  PositionEntity entity,x#,y#,z#,[,global]  

- -

-Parameters:
-

- - - - +

PositionEntity entity,x#,y#,z#,[,global]

+

Parameters

+
entity - name of entity to be positioned
-x# - x co-ordinate that entity will be positioned at
-y# - y co-ordinate that entity will be positioned at
-z# - z co-ordinate that entity will be positioned at
-global (optional) - true if the position should be relative to 0,0,0 rather than -a parent entity's position. False by default.
+ + +
+entity - name of entity to be positioned
+x# - x co-ordinate that entity will be positioned at
+y# - y co-ordinate that entity will be positioned at
+z# - z co-ordinate that entity will be positioned at
+global (optional) - true if the position should be relative to 0,0,0 rather than a parent entity's position. False by default. +
-

Description:
-
- - -
Positions an entity at an absolute position in 3D space.
+

Description

+ + + - +See also: MoveEntity, TranslateEntity, PositionMesh. + +
+Positions an entity at an absolute position in 3D space.
+
+Entities are positioned using an x,y,z coordinate system. x, y and z each have their own axis, and each axis has its own set of values. By specifying a value for each axis, you can position an entity anywhere in 3D space. 0,0,0 is the centre of 3D space, and if the camera is pointing in the default positive z direction, then positioning an entity with a z value of above 0 will make it appear in front of the camera, whereas a negative z value would see it disappear behind the camera. Changing the x value would see it moving sideways, and changing the y value would see it moving up/down.
+
+Of course, the direction in which entities appear to move is relative to the position and orientation of the camera.
-Entities are positioned using an x,y,z coordinate system. x, y and z each have -their own axis, and each axis has its own set of values. By specifying a value -for each axis, you can position an entity anywhere in 3D space. 0,0,0 is the -centre of 3D space, and if the camera is pointing in the default positive z -direction, then positioning an entity with a z value of above 0 will make it -appear in front of the camera, whereas a negative z value would see it disappear -behind the camera. Changing the x value would see it moving sideways, and -changing the y value would see it moving up/down.

-Of course, the direction in which entities appear to move is relative to the -position and orientation of the camera.

See also: - MoveEntity, TranslateEntity.

-

Example:
-
- - - - - +

Example

+
; PositionEntity Example
- ; ----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
-
- ; Set position values so that cone is positioned in front of camera, so we - can see it to begin with
- x#=0
- y#=0
- z#=10
-
- While Not KeyDown( 1 )
-
- ; Change position values depending on key pressed
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.1
-
- ; Position cone using position values
- PositionEntity cone,x#,y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to change cone position"
- Text 0,20,"X Position: "+x#
- Text 0,40,"Y Position: "+y#
- Text 0,60,"Z Position: "+z#
-
- Flip
-
- Wend
-
- End
+ + +
+; PositionEntity Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+
+; Set position values so that cone is positioned in front of camera, so we can see it to begin with
+x#=0
+y#=0
+z#=10
+
+While Not KeyDown( 1 )
+
+; Change position values depending on key pressed
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.1
+
+; Position cone using position values
+PositionEntity cone,x#,y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to change cone position"
+Text 0,20,"X Position: "+x#
+Text 0,40,"Y Position: "+y#
+Text 0,60,"Z Position: "+z#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/PositionMesh.htm b/_release/help/commands/3d_commands/PositionMesh.htm index a3d7aae..72fb571 100644 --- a/_release/help/commands/3d_commands/PositionMesh.htm +++ b/_release/help/commands/3d_commands/PositionMesh.htm @@ -1,40 +1,82 @@ -Command: PositionMesh - - +Blitz3D Docs + - - -

  PositionMesh mesh,x#,y#,z#  

- -

-Parameters:
-

- - - - +

PositionMesh mesh,x#,y#,z#

+

Parameters

+
mesh - mesh handle
- x# - x position of mesh
- y# - y position of mesh
- z# - z position of mesh
+ + +
+mesh - mesh handle
+x# - x position of mesh
+y# - y position of mesh
+z# - z position of mesh +
-

Description:
-
- - - - +

Description

+
Moves all vertices of a mesh.
+ + +
+Moves all vertices of a mesh. +
+
+See also: PositionEntity, MoveEntity, TranslateEntity. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; PositionMesh Example
+; --------------------
+
+; In this example we will demonstrate the use of the PositionMesh command.
+
+; Unlike PositionEntity, PositionMesh actually modifies the actual mesh structure.
+
+; So whereas using PositionEntity 0,0,1 would only move an entity by one unit the first time it was
+; used, PositionMesh 0,0,1 will move the mesh by one unit every time it is used.
+
+; This is because PositionEntity positions an entity based on a fixed mesh structure, whereas
+; PositionMesh actually modifies the mesh structure itself.
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+
+; Create cube mesh
+cube=CreateCube()
+
+; Position cube in front of camera so we can see it
+PositionEntity cube,0,0,5
+
+While Not KeyDown(1)
+
+ ; If space bar pressed then position mesh 1 unit along the z axis. Also set syntax$ text.
+ If KeyHit(57)=True Then PositionMesh cube,0,0,1 : syntax$="PositionMesh 0,0,1"
+
+ RenderWorld
+
+ Text 0,0,"Press space to position the mesh 1 unit along the z axis"
+ Text 0,20,syntax$
+
+ Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/PositionTexture.htm b/_release/help/commands/3d_commands/PositionTexture.htm index f16226d..c16cf30 100644 --- a/_release/help/commands/3d_commands/PositionTexture.htm +++ b/_release/help/commands/3d_commands/PositionTexture.htm @@ -1,90 +1,89 @@ -Command: PositionTexture - - +Blitz3D Docs + - - -

  PositionTexture texture,u_position#,v_position#  

- -

-Parameters:
-

- - - - +

PositionTexture texture,u_position#,v_position#

+

Parameters

+
texture - texture handle
- u_position# - u position of texture
- v_position# - v position of texture
+ + +
+texture - texture handle
+u_position# - u position of texture
+v_position# - v position of texture +
-

Description:
-
- - - - +

Description

+
Positions a texture at an absolute position.

This will have an - immediate effect on all instances of the texture being used.

-

Positioning a texture is useful for performing scrolling texture effects, - such as for water etc.

-
+ + +
+Positions a texture at an absolute position.
+
+This will have an immediate effect on all instances of the texture being used.
+
+Positioning a texture is useful for performing scrolling texture effects, such as for water etc. +
-

Example:
-
- - - - - +

Example

+
; PositionTexture Example
- ; -----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture( "media/b3dlogo.jpg" )
-
- ; Texture cube
- EntityTexture cube,tex
-
- ; Set initial uv position values
- u_position#=1
- v_position#=1
-
- While Not KeyDown( 1 )
-
- ; Change uv position values depending on key pressed
- If KeyDown( 208 )=True Then u_position#=u_position#-0.01
- If KeyDown( 200 )=True Then u_position#=u_position#+0.01
- If KeyDown( 203 )=True Then v_position#=v_position#-0.01
- If KeyDown( 205 )=True Then v_position#=v_position#+0.01
-
- ; Position texture
- PositionTexture tex,u_position#,v_position#
-
- TurnEntity cube,0.1,0.1,0.1
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to change uv position values"
- Text 0,20,"u_position#="+u_position#
- Text 0,40,"v_position#="+v_position#
-
- Flip
-
- Wend
-
- End
+ + +
+; PositionTexture Example
+; -----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Texture cube
+EntityTexture cube,tex
+
+; Set initial uv position values
+u_position#=1
+v_position#=1
+
+While Not KeyDown( 1 )
+
+; Change uv position values depending on key pressed
+If KeyDown( 208 )=True Then u_position#=u_position#-0.01
+If KeyDown( 200 )=True Then u_position#=u_position#+0.01
+If KeyDown( 203 )=True Then v_position#=v_position#-0.01
+If KeyDown( 205 )=True Then v_position#=v_position#+0.01
+
+; Position texture
+PositionTexture tex,u_position#,v_position#
+
+TurnEntity cube,0.1,0.1,0.1
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to change uv position values"
+Text 0,20,"u_position#="+u_position#
+Text 0,40,"v_position#="+v_position#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/ProjectedX.htm b/_release/help/commands/3d_commands/ProjectedX.htm index 0575365..2675d4b 100644 --- a/_release/help/commands/3d_commands/ProjectedX.htm +++ b/_release/help/commands/3d_commands/ProjectedX.htm @@ -1,38 +1,88 @@ -Command: ProjectedX - - +Blitz3D Docs + - - -

  ProjectedX# ( )  

- -

-Parameters:
-

- - - - +

ProjectedX# ( )

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Returns the viewport x coordinate of the most recently executed - CameraProject.
+ + +
+Returns the viewport x coordinate of the most recently executed CameraProject. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; ProjectedX 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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ProjectedY.htm b/_release/help/commands/3d_commands/ProjectedY.htm index 6671748..c59097e 100644 --- a/_release/help/commands/3d_commands/ProjectedY.htm +++ b/_release/help/commands/3d_commands/ProjectedY.htm @@ -1,38 +1,88 @@ -Command: ProjectedY - - +Blitz3D Docs + - - -

  ProjectedY# ( )  

- -

-Parameters:
-

- - - - +

ProjectedY# ( )

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Returns the viewport y coordinate of the most recently executed - CameraProject.
+ + +
+Returns the viewport y coordinate of the most recently executed CameraProject. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; ProjectedY 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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ProjectedZ.htm b/_release/help/commands/3d_commands/ProjectedZ.htm index b16bdba..108d7ae 100644 --- a/_release/help/commands/3d_commands/ProjectedZ.htm +++ b/_release/help/commands/3d_commands/ProjectedZ.htm @@ -1,38 +1,88 @@ -Command: ProjectedZ - - +Blitz3D Docs + - - -

  ProjectedZ# ( )  

- -

-Parameters:
-

- - - - +

ProjectedZ# ( )

+

Parameters

+
None.
+ + +
+None. +
-

Description:
-
- - - - +

Description

+
Returns the viewport z coordinate of the most recently executed - CameraProject.
+ + +
+Returns the viewport z coordinate of the most recently executed CameraProject. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; ProjectedZ 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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/RenderWorld.htm b/_release/help/commands/3d_commands/RenderWorld.htm index 5859271..6ce230b 100644 --- a/_release/help/commands/3d_commands/RenderWorld.htm +++ b/_release/help/commands/3d_commands/RenderWorld.htm @@ -1,52 +1,37 @@ -Command: RenderWorld - - +Blitz3D Docs + - - -

  RenderWorld [tween#]  

- -

-Parameters:
-

- - - - +

RenderWorld [tween#]

+

Parameters

+
tween# - defaults to 1.
+ + +
+tween# (optional) - defaults to 1. +
-

Description:
-
- - - - +

Description

+
Renders all entities in the world.

The optional tween parameter can be used to render - entities at a point somewhere between their captured position and their - current position. A tween value of 0 will render entities at their captured - position, a tween value of 1 will render entities at their current position. - Other values may be used for interpolation. Defaults to 1.

Tweening is a - technique used to allow games to have their game logic updated a fixed amount - of times, e.g. 30, while having Blitz3D interpolate between these game logic - updates to render as many frames per second as it can, e.g. 60+, with each - frame different to the last.

This results in a game which only has to have - its game logic updated at half the rate of the renders per second, freeing - up CPU time, while at the same time having the game run as smooth as - possible on anybody's machine.

Render tweening is quite an - advanced technique, and it is not necessary to use it, so don't worry if you don't quite understand it. See the - castle demo included in the mak (nickname of Mark Sibly, author of Blitz3D) - directory of the Blitz3D samples section for a demonstration of render - tweening.

+ + +
+Renders the current scene to the BackBuffer onto the rectangle defined by each cameras CameraViewport( ). Every camera not hidden by HideEntity( ) or with a CameraProjMode( ) of 0 is rendered. Rendering to other buffers is currently not supported by Blitz3D.
+
+The optional tween parameter should only be specified when RenderWorld is used in conjunction with CaptureWorld. CaptureWorld is used to store the 'old' position, rotation and scale, alpha and colour of each entity in the game world, and a tween value of < 1 will interpolate between these 'old' values and the 'current' ones. A tween value of 0 will render all entities at their state when CaptureWorld was last called, and a tween value of 1 will render all entities at their current state.
+
+The use of tweening allows you to render more than one frame per game logic update, while still keeping the display smooth. This allows you to cut down on the CPU time that would be required to update your game logic every render. Note, however, that the bottleneck in almost all 3D applications is the graphics card and the CPU time involved in updating game logic is often very little. A good alternative to render tweening is the use of a delta time, that is, moving your entities each frame depending on the time it took for the program to process and render that frame.
+
+Render tweening is quite an advanced technique, and it is not necessary to use it, so don't worry if you don't quite understand it. See the castle demo included in the mak (nickname of Mark Sibly, author of Blitz3D) directory of the Blitz3D samples section for a demonstration of render tweening. +
+
+See also: CaptureWorld, CameraViewport, CameraProjMode. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ResetEntity.htm b/_release/help/commands/3d_commands/ResetEntity.htm index 097077a..f0903ca 100644 --- a/_release/help/commands/3d_commands/ResetEntity.htm +++ b/_release/help/commands/3d_commands/ResetEntity.htm @@ -1,37 +1,31 @@ -Command: ResetEntity - - +Blitz3D Docs + - - -

  ResetEntity entity  

- -

-Parameters:
-

- - - - +

ResetEntity entity

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Resets the collision state of an entity.
+ + +
+Resets the collision state of an entity. +
+
+See also: EntityBox, EntityRadius, Collisions, EntityType, GetEntityType. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/RotateEntity.htm b/_release/help/commands/3d_commands/RotateEntity.htm index a4978ce..d957b20 100644 --- a/_release/help/commands/3d_commands/RotateEntity.htm +++ b/_release/help/commands/3d_commands/RotateEntity.htm @@ -1,87 +1,85 @@ -Command: RotateEntity - - +Blitz3D Docs + - - -

  RotateEntity entity,pitch#,yaw#,roll#,[,global]  

- -

-Parameters:
-

- - - - +

RotateEntity entity,pitch#,yaw#,roll#,[,global]

+

Parameters

+
entity - name of the entity to be rotated
-pitch# - angle in degrees of pitch rotation
-yaw# - angle in degrees of yaw rotation
-roll# - angle in degrees of roll rotation
-global (optional) - true if the angle rotated should be relative to 0,0,0 rather -than a parent entity's orientation. False by default.
+ + +
+entity - name of the entity to be rotated
+pitch# - angle in degrees of pitch rotation
+yaw# - angle in degrees of yaw rotation
+roll# - angle in degrees of roll rotation
+global (optional) - true if the angle rotated should be relative to 0,0,0 rather than a parent entity's orientation. False by default. +
-

Description:
-
- - -
Rotates an entity so that it is at an absolute orientation.
+

Description

+ + + - +See also: TurnEntity, RotateMesh. + +
+Rotates an entity so that it is at an absolute orientation.
+
+Pitch is the same as the x angle of an entity, and is equivalent to tilting forward/backwards.
+
+Yaw is the same as the y angle of an entity, and is equivalent to turning left/right.
+
+Roll is the same as the z angle of an entity, and is equivalent to tilting left/right.
-Pitch is the same as the x angle of an entity, and is equivalent to tilting -forward/backwards.

-Yaw is the same as the y angle of an entity, and is equivalent to turning -left/right.
-
-Roll is the same as the z angle of an entity, and is equivalent to tilting -left/right.

See also: TurnEntity.

-

Example:
-
- - - - - +

Example

+
; RotateEntity Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
-
- ; Change rotation values depending on the key pressed
- If KeyDown( 208 )=True Then pitch#=pitch#-1
- If KeyDown( 200 )=True Then pitch#=pitch#+1
- If KeyDown( 203 )=True Then yaw#=yaw#-1
- If KeyDown( 205 )=True Then yaw#=yaw#+1
- If KeyDown( 45 )=True Then roll#=roll#-1
- If KeyDown( 44 )=True Then roll#=roll#+1
-
- ; Rotate cone using rotation values
- RotateEntity cone,pitch#,yaw#,roll#
-
- RenderWorld
-
- Text 0,0,"Use cursor/Z/X keys to change cone rotation"
- Text 0,20,"Pitch: "+pitch#
- Text 0,40,"Yaw : "+yaw#
- Text 0,60,"Roll : "+roll#
-
- Flip
-
- Wend
-
- End
+ + +
+; RotateEntity Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+
+; Change rotation values depending on the key pressed
+If KeyDown( 208 )=True Then pitch#=pitch#-1
+If KeyDown( 200 )=True Then pitch#=pitch#+1
+If KeyDown( 203 )=True Then yaw#=yaw#-1
+If KeyDown( 205 )=True Then yaw#=yaw#+1
+If KeyDown( 45 )=True Then roll#=roll#-1
+If KeyDown( 44 )=True Then roll#=roll#+1
+
+; Rotate cone using rotation values
+RotateEntity cone,pitch#,yaw#,roll#
+
+RenderWorld
+
+Text 0,0,"Use cursor/Z/X keys to change cone rotation"
+Text 0,20,"Pitch: "+pitch#
+Text 0,40,"Yaw : "+yaw#
+Text 0,60,"Roll : "+roll#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/RotateMesh.htm b/_release/help/commands/3d_commands/RotateMesh.htm index e02b568..973897e 100644 --- a/_release/help/commands/3d_commands/RotateMesh.htm +++ b/_release/help/commands/3d_commands/RotateMesh.htm @@ -1,40 +1,85 @@ -Command: RotateMesh - - +Blitz3D Docs + - - -

  RotateMesh mesh,pitch#,yaw#,roll#  

- -

-Parameters:
-

- - - - +

RotateMesh mesh,pitch#,yaw#,roll#

+

Parameters

+
mesh - mesh handle
- pitch# - pitch of mesh
- yaw# - yaw of mesh
- roll# - roll of mesh
+ + +
+mesh - mesh handle
+pitch# - pitch of mesh
+yaw# - yaw of mesh
+roll# - roll of mesh +
-

Description:
-
- - - - +

Description

+
Rotates all vertices of a mesh by the specified rotation.
+ + +
+Rotates all vertices of a mesh by the specified rotation. +
+
+See also: RotateEntity, TurnEntity. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; RotateMesh Example
+; ------------------
+
+; In this example we will demonstrate the use of the RotateMesh command.
+
+; Unlike RotateEntity, RotateMesh actually modifies the actual mesh structure.
+
+; So whereas using RotateEntity 0,45,0 would only rotate an entity by 45 degrees the first time it was
+; used, RotateMesh 0,45,0 will rotate the mesh every time it is used.
+
+; This is because RotateEntity rotates an entity based on a fixed mesh structure, whereas RotateMesh
+; actually modifies the mesh structure itself.
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+
+; Rotate light to give better lighting of cube
+RotateEntity light,60,30,0
+
+; Create cube mesh
+cube=CreateCube()
+
+; Position cube in front of camera so we can see it
+PositionEntity cube,0,0,5
+
+While Not KeyDown(1)
+
+ ; If space bar pressed then rotate mesh by 45 degrees on the y axis. Also set syntax$ text.
+ If KeyHit(57)=True Then RotateMesh cube,0,45,0 : syntax$="RotateMesh 0,45,0"
+
+ RenderWorld
+
+ Text 0,0,"Press space to rotate mesh by 45 degrees on the y axis"
+ Text 0,20,syntax$
+
+ Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/RotateSprite.htm b/_release/help/commands/3d_commands/RotateSprite.htm index a07cf7e..fc0376d 100644 --- a/_release/help/commands/3d_commands/RotateSprite.htm +++ b/_release/help/commands/3d_commands/RotateSprite.htm @@ -1,38 +1,53 @@ -Command: RotateSprite - - +Blitz3D Docs + - - -

  RotateSprite sprite,angle#  

- -

-Parameters:
-

- - - - +

RotateSprite sprite,angle#

+

Parameters

+
sprite - sprite handle
- angle# - absolute angle of sprite rotation
+ + +
+sprite - sprite handle
+angle# - absolute angle of sprite rotation +
-

Description:
-
- - - - +

Description

+
Rotates a sprite.
+ + +
+Rotates a sprite. +
+
+See also: CreateSprite, LoadSprite. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+cam = CreateCamera()
+MoveEntity cam,0,0,-5
+
+sp = CreateSprite()
+
+ang# = 0
+While Not KeyDown(1)
+RenderWorld:Flip
+RotateSprite sp,ang
+ang = ang +3
+Wend
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/RotateTexture.htm b/_release/help/commands/3d_commands/RotateTexture.htm index c14e0ef..e139459 100644 --- a/_release/help/commands/3d_commands/RotateTexture.htm +++ b/_release/help/commands/3d_commands/RotateTexture.htm @@ -1,85 +1,84 @@ -Command: RotateTexture - - +Blitz3D Docs + - - -

  RotateTexture texture,angle#  

- -

-Parameters:
-

- - - - +

RotateTexture texture,angle#

+

Parameters

+
texture - texture handle
- angle# - absolute angle of texture rotation
+ + +
+texture - texture handle
+angle# - absolute angle of texture rotation +
-

Description:
-
- - - - +

Description

+
Rotates a texture.

This will have an immediate effect on all instances - of the texture being used.

-

Rotating a texture is useful for performing swirling texture effects, - such as for smoke etc.

-
+ + +
+Rotates a texture.
+
+This will have an immediate effect on all instances of the texture being used.
+
+Rotating a texture is useful for performing swirling texture effects, such as for smoke etc. +
-

Example:
-
- - - - - +

Example

+
; RotateTexture Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture( "media/b3dlogo.jpg" )
-
- ; Texture cube
- EntityTexture cube,tex
-
- ; Set initial texture angle value
- angle#=1
-
- While Not KeyDown( 1 )
-
- ; Change texture angle value depending on key pressed
- If KeyDown( 205 )=True Then angle#=angle#-1
- If KeyDown( 203 )=True Then angle#=angle#+1
-
- ; Rotate texture
- RotateTexture tex,angle#
-
- TurnEntity cube,0.1,0.1,0.1
-
- RenderWorld
-
- Text 0,0,"Use left and right cursor keys to change texture angle value"
- Text 0,20,"angle#="+angle#
-
- Flip
-
- Wend
-
- End
+ + +
+; RotateTexture Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Texture cube
+EntityTexture cube,tex
+
+; Set initial texture angle value
+angle#=1
+
+While Not KeyDown( 1 )
+
+; Change texture angle value depending on key pressed
+If KeyDown( 205 )=True Then angle#=angle#-1
+If KeyDown( 203 )=True Then angle#=angle#+1
+
+; Rotate texture
+RotateTexture tex,angle#
+
+TurnEntity cube,0.1,0.1,0.1
+
+RenderWorld
+
+Text 0,0,"Use left and right cursor keys to change texture angle value"
+Text 0,20,"angle#="+angle#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/ScaleEntity.htm b/_release/help/commands/3d_commands/ScaleEntity.htm index b01eaae..e24a424 100644 --- a/_release/help/commands/3d_commands/ScaleEntity.htm +++ b/_release/help/commands/3d_commands/ScaleEntity.htm @@ -1,90 +1,92 @@ -Command: ScaleEntity - - +Blitz3D Docs + - - -

  ScaleEntity entity,x_scale#,y_scale#,z_scalel#,[,global]  

- -

-Parameters:
-

- - - - +

ScaleEntity entity,x_scale#,y_scale#,z_scalel#,[,global]

+

Parameters

+
entity - name of the entity to be scaled
-x_scale# - x size of entity
-y_scale# - y size of entity
-z_scale# - z size of entity
-global (optional) -
+ + +
+entity - name of the entity to be scaled
+x_scale# - x size of entity
+y_scale# - y size of entity
+z_scale# - z size of entity
+global (optional) - +
-

Description:
-
- - -
Scales an entity so that it is of an absolute size.
+

Description

+ + + - +See also: ScaleMesh, FitMesh. + +
+Scales an entity so that it is of an absolute size.
+
+Scale values of 1,1,1 are the default size when creating/loading entities.
+
+Scale values of 2,2,2 will double the size of an entity.
+
+Scale values of 0,0,0 will make an entity disappear.
+
+Scale values of less than 0,0,0 will invert an entity and make it bigger.
-Scale values of 1,1,1 are the default size when creating/loading entities.

-Scale values of 2,2,2 will double the size of an entity.
-
-Scale values of 0,0,0 will make an entity disappear.
-
-Scale values of less than 0,0,0 will invert an entity and make it bigger.
-

Example:
-
- - - - - +

Example

+
; ScaleEntity Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- ; Set scale values so that cone is default size to begin with
- x_scale#=1
- y_scale#=1
- z_scale#=1
-
- While Not KeyDown( 1 )
-
- ; Change scale values depending on the key pressed
- If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1
- If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1
- If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1
- If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1
- If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1
- If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1
-
- ; Scale cone using scale values
- ScaleEntity cone,x_scale#,y_scale#,z_scale#
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to scale cone"
- Text 0,20,"X Scale: "+x_scale#
- Text 0,40,"Y Scale: "+y_scale#
- Text 0,60,"Z Scale: "+z_scale#
-
- Flip
-
- Wend
-
- End
+ + +
+; ScaleEntity Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+; Set scale values so that cone is default size to begin with
+x_scale#=1
+y_scale#=1
+z_scale#=1
+
+While Not KeyDown( 1 )
+
+; Change scale values depending on the key pressed
+If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1
+If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1
+If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1
+If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1
+If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1
+If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1
+
+; Scale cone using scale values
+ScaleEntity cone,x_scale#,y_scale#,z_scale#
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to scale cone"
+Text 0,20,"X Scale: "+x_scale#
+Text 0,40,"Y Scale: "+y_scale#
+Text 0,60,"Z Scale: "+z_scale#
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ScaleMesh.htm b/_release/help/commands/3d_commands/ScaleMesh.htm index 1d2eaf4..68fe408 100644 --- a/_release/help/commands/3d_commands/ScaleMesh.htm +++ b/_release/help/commands/3d_commands/ScaleMesh.htm @@ -1,40 +1,82 @@ -Command: ScaleMesh - - +Blitz3D Docs + - - -

  ScaleMesh mesh,x_scale#,y_scale#,z_scale#  

- -

-Parameters:
-

- - - - +

ScaleMesh mesh,x_scale#,y_scale#,z_scale#

+

Parameters

+
mesh - mesh handle
- x_scale# - x scale of mesh
- y_scale# - y scale of mesh
- z_scale# - z scale of mesh
+ + +
+mesh - mesh handle
+x_scale# - x scale of mesh
+y_scale# - y scale of mesh
+z_scale# - z scale of mesh +
-

Description:
-
- - - - +

Description

+
Scales all vertices of a mesh by the specified scaling factors.
+ + +
+Scales all vertices of a mesh by the specified scaling factors. +
+
+See also: FitMesh, ScaleEntity. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; ScaleMesh Example
+; -----------------
+
+; In this example we will demonstrate the use of the ScaleMesh command.
+
+; Unlike ScaleEntity, ScaleMesh actually modifies the actual mesh structure.
+
+; So whereas using ScaleEntity 2,2,2 would only double the size of an entity the first time it was
+; used, ScaleMesh 2,2,2 will double the size of the mesh every time it is used.
+
+; This is because ScaleEntity scales an entity based on a fixed mesh structure, whereas ScaleMesh
+; actually modifies the mesh structure itself.
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+
+; Create cube mesh
+cube=CreateCube()
+
+; Position cube in front of camera so we can see it
+PositionEntity cube,0,0,5
+
+While Not KeyDown(1)
+
+ ; If space bar pressed then scale cube mesh by 1%. Also set syntax$ text.
+ If KeyHit(57)=True Then ScaleMesh cube,1.01,1.01,1.01 : syntax$="ScaleMesh 1.01,1.01,1.01"
+
+ RenderWorld
+
+ Text 0,0,"Press space to scale mesh by 1%"
+ Text 0,20,syntax$
+
+ Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ScaleSprite.htm b/_release/help/commands/3d_commands/ScaleSprite.htm index da021f1..6d080ec 100644 --- a/_release/help/commands/3d_commands/ScaleSprite.htm +++ b/_release/help/commands/3d_commands/ScaleSprite.htm @@ -1,39 +1,54 @@ -Command: ScaleSprite - - +Blitz3D Docs + - - -

  ScaleSprite sprite,x_scale#,y_scale#  

- -

-Parameters:
-

- - - - +

ScaleSprite sprite,x_scale#,y_scale#

+

Parameters

+
sprite - sprite handle
- x_scale# - x scale of sprite
- y scale# - y scale of sprite
+ + +
+sprite - sprite handle
+x_scale# - x scale of sprite
+y scale# - y scale of sprite +
-

Description:
-
- - - - +

Description

+
Scales a sprite.
+ + +
+Scales a sprite. +
+
+See also: LoadSprite, CreateSprite. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+Graphics3D 640,480
+
+cam = CreateCamera()
+MoveEntity cam,0,0,-5
+
+sp = CreateSprite()
+
+size# = 1.0
+While Not KeyDown(1)
+RenderWorld:Flip
+ScaleSprite sp,size,size
+size = size + 0.01
+Wend
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ScaleTexture.htm b/_release/help/commands/3d_commands/ScaleTexture.htm index 6dc40ef..85587fe 100644 --- a/_release/help/commands/3d_commands/ScaleTexture.htm +++ b/_release/help/commands/3d_commands/ScaleTexture.htm @@ -1,88 +1,87 @@ -Command: ScaleTexture - - +Blitz3D Docs + - - -

  ScaleTexture texture,u_scale#,v_scale#  

- -

-Parameters:
-

- - - - +

ScaleTexture texture,u_scale#,v_scale#

+

Parameters

+
texture - name of texture
- u_scale# - u scale
- v_scale# - v scale
+ + +
+texture - name of texture
+u_scale# - u scale
+v_scale# - v scale +
-

Description:
-
- - - - +

Description

+
Scales a texture by an absolute amount.

This will have an immediate - effect on all instances of the texture being used.

-
+ + +
+Scales a texture by an absolute amount.
+
+This will have an immediate effect on all instances of the texture being used. +
-

Example:
-
- - - - - +

Example

+
; ScaleTexture Example
- ; --------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Load texture
- tex=LoadTexture( "media/b3dlogo.jpg" )
-
- ; Texture cube
- EntityTexture cube,tex
-
- ; Set initial uv scale values
- u_scale#=1
- v_scale#=1
-
- While Not KeyDown( 1 )
-
- ; Change uv scale values depending on key pressed
- If KeyDown( 208 )=True Then u_scale#=u_scale#-0.01
- If KeyDown( 200 )=True Then u_scale#=u_scale#+0.01
- If KeyDown( 203 )=True Then v_scale#=v_scale#-0.01
- If KeyDown( 205 )=True Then v_scale#=v_scale#+0.01
-
- ; Scale texture
- ScaleTexture tex,u_scale#,v_scale#
-
- TurnEntity cube,0.1,0.1,0.1
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to change uv scale values"
- Text 0,20,"u_scale#="+u_scale#
- Text 0,40,"v_scale#="+v_scale#
-
- Flip
-
- Wend
-
- End
+ + +
+; ScaleTexture Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load texture
+tex=LoadTexture( "media/b3dlogo.jpg" )
+
+; Texture cube
+EntityTexture cube,tex
+
+; Set initial uv scale values
+u_scale#=1
+v_scale#=1
+
+While Not KeyDown( 1 )
+
+; Change uv scale values depending on key pressed
+If KeyDown( 208 )=True Then u_scale#=u_scale#-0.01
+If KeyDown( 200 )=True Then u_scale#=u_scale#+0.01
+If KeyDown( 203 )=True Then v_scale#=v_scale#-0.01
+If KeyDown( 205 )=True Then v_scale#=v_scale#+0.01
+
+; Scale texture
+ScaleTexture tex,u_scale#,v_scale#
+
+TurnEntity cube,0.1,0.1,0.1
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to change uv scale values"
+Text 0,20,"u_scale#="+u_scale#
+Text 0,40,"v_scale#="+v_scale#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/SetAnimKey.htm b/_release/help/commands/3d_commands/SetAnimKey.htm index 18c40d8..5be7fdd 100644 --- a/_release/help/commands/3d_commands/SetAnimKey.htm +++ b/_release/help/commands/3d_commands/SetAnimKey.htm @@ -1,45 +1,93 @@ -Command: SetAnimKey - - +Blitz3D Docs + - - -

  SetAnimKey -entity,frame[,pos_key][,rot_key][,scale_key]  

- -

-Parameters:
-

- - - - +

SetAnimKey entity,frame[,pos_key][,rot_key][,scale_key]

+

Parameters

+
entity - entity handle
- frame - frame of animation to be used as anim key
- pos_key (optional) - true to include entity position information when - setting key. Defaults to true.
- rot_key (optional) - true to include entity rotation information when - setting key. Defaults to true.
- scale_key (optional) - true to include entity scale information when setting - key. Defaults to true.
+ + +
+entity - entity handle
+frame - frame of animation to be used as anim key
+pos_key (optional) - true to include entity position information when setting key. Defaults to true.
+rot_key (optional) - true to include entity rotation information when setting key. Defaults to true.
+scale_key (optional) - true to include entity scale information when setting key. Defaults to true. +
-

Description:
-
- - - - +

Description

+
Sets an animation key for the specified entity at the specified frame.
+ + +
+Sets an animation key for the specified entity at the specified frame. The entity must have a valid animation sequence to work with.
+
+This is most useful when you've got a character, or a complete set of complicated moves to perform, and you want to perform them en-masse. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+;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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/ShowEntity.htm b/_release/help/commands/3d_commands/ShowEntity.htm index 0c9f26e..1488009 100644 --- a/_release/help/commands/3d_commands/ShowEntity.htm +++ b/_release/help/commands/3d_commands/ShowEntity.htm @@ -1,44 +1,34 @@ -Command: ShowEntity - - +Blitz3D Docs + - - -

  ShowEntity entity  

- -

-Parameters:
-

- - - - +

ShowEntity entity

+

Parameters

+
entity - entity handle
+ + +
+entity - entity handle +
-

Description:
-
- - - - +

Description

+
Shows an entity. Very much the opposite of - HideEntity.

Once an entity has been hidden using - HideEntity, use show entity to make it visible - and involved in collisions again.

-

Entities are shown by default after creating/loading them, so you should - only need to use ShowEntity after using HideEntity.

- ShowEntity affects the specified entity and all of its child - entities, if any exist.

+ + +
+Shows an entity. Very much the opposite of HideEntity.
+
+Once an entity has been hidden using HideEntity, use show entity to make it visible and involved in collisions again. Note that ShowEntity has no effect if the enitities parent object is hidden.
+
+Entities are shown by default after creating/loading them, so you should only need to use ShowEntity after using HideEntity.
+
+ShowEntity affects the specified entity only - child entities are not affected. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/SpriteViewMode.htm b/_release/help/commands/3d_commands/SpriteViewMode.htm index 1d41957..79de8df 100644 --- a/_release/help/commands/3d_commands/SpriteViewMode.htm +++ b/_release/help/commands/3d_commands/SpriteViewMode.htm @@ -1,42 +1,116 @@ -Command: SpriteViewMode - - +Blitz3D Docs + - - -

  SpriteViewMode sprite,view_mode  

- -

-Parameters:
-

- - - - +

SpriteViewMode sprite,view_mode

+

Parameters

+
sprite - sprite handle
-
- view_mode - view_mode of sprite
- 1: fixed (sprite always faces camera)
- 2: free (sprite is independent of camera)
- 3: upright (sprite always faces camera, but tilts with camera)
+ + +
+sprite - sprite handle
+
+view_mode - view_mode of sprite
+1: fixed (sprite always faces camera - default)
+2: free (sprite is independent of camera)
+3: upright1 (sprite always faces camera, but rolls with camera as well, unlike mode no.1)
+4: upright2 (sprite always remains upright. Gives a 'billboard' effect. Good for trees, spectators etc.) +
-

Description:
-
- - - - +

Description

+
Sets the viewmode of a sprite.
+ + +
+Sets the view mode of a sprite.
+
+The view mode determines how a sprite alters its orientation in respect to the camera. This allows the sprite to in some instances give the impression that it is more than two dimensional.
+
+In technical terms, the four sprite modes perform the following changes:
+
+1: Sprite changes its pitch and yaw values to face camera, but doesn't roll.
+2: Sprite does not change either its pitch, yaw or roll values.
+3: Sprite changes its yaw and pitch to face camera, and changes its roll value to match cameras.
+4: Sprite changes its yaw value to face camera, but not its pitch value, and changes its roll value to match cameras.
+
+Note that if you use sprite view mode 2, then because it is independent from the camera, you will only be able to see it from one side unless you use EntityFx flag 16 with it to disable backface culling. +
+
+See also: CreateSprite, LoadSprite. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; SpriteViewMode Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+pivot=CreatePivot()
+PositionEntity pivot,0,1,0
+
+camera=CreateCamera(pivot)
+PositionEntity camera,0,0,10
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+plane=CreatePlane()
+ground_tex=LoadTexture("media/Chorme-2.bmp")
+EntityTexture plane,ground_tex
+
+sprite=LoadSprite("media/b3dlogo.jpg")
+PositionEntity sprite,0,1,0
+
+pitch=-15
+yaw=180
+roll=0
+view_mode=1
+view_mode_info$=" (fixed)"
+
+While Not KeyDown(1)
+
+If KeyDown(208)=True And pitch<0 Then pitch=pitch+1
+If KeyDown(200)=True And pitch>-89 Then pitch=pitch-1
+If KeyDown(205)=True Then yaw=yaw+1
+If KeyDown(203)=True Then yaw=yaw-1
+If KeyDown(30)=True Then roll=roll+1
+If KeyDown(31)=True Then roll=roll-1
+
+; Change sprite view mode depending on key pressed
+If KeyHit(2)=True Then view_mode=1 : view_mode_info$=" (fixed)"
+If KeyHit(3)=True Then view_mode=2 : view_mode_info$=" (free)"
+If KeyHit(4)=True Then view_mode=3 : view_mode_info$=" (upright1)"
+If KeyHit(5)=True Then view_mode=4 : view_mode_info$=" (upright2)"
+
+; Set sprite view mode
+SpriteViewMode sprite,view_mode
+
+RotateEntity pivot,pitch,yaw,0
+PointEntity camera,sprite,roll
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to orbit camera around sprite"
+Text 0,20,"Press A and S keys to roll camera"
+Text 0,40,"Press keys 1-4 to change sprite view mode"
+Text 0,60,"SpriteViewMode: "+view_mode+view_mode_info$
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TFormNormal.htm b/_release/help/commands/3d_commands/TFormNormal.htm index 3d2159e..2201e8f 100644 --- a/_release/help/commands/3d_commands/TFormNormal.htm +++ b/_release/help/commands/3d_commands/TFormNormal.htm @@ -1,37 +1,68 @@ -Command: TFormNormal - - +Blitz3D Docs + - - -

  TFormNormal  

- -

-Parameters:
-

- - - - +

TFormNormal x#, y#, z#, source_entity, dest_entity

+

Parameters

+
<param description>
+ + +
+x#, y#, z# = components of a vector in 3d space
+
+source_entity = handle of source entity, or 0 for 3d world
+dest_entity = handle of destination entity, or 0 for 3d world +
-

Description:
-
- - - - +

Description

+
<description>
+ + +
+Transforms between coordinate systems. After using TFormNormal the new
+components can be read with TFormedX(), TFormedY() and TFormedZ().
+
+This is exactly the same as TFormVector but with one added feature.
+After the transformation the new vector is 'normalized', meaning it
+is scaled to have length 1.
+
+For example, suppose the result of TFormVector is (1,2,2).
+This vector has length Sqr( 1*1 + 2*2 + 2*2 ) = Sqr( 9 ) = 3.
+
+This means TFormNormal would produce ( 1/3, 2/3, 2/3 ). +
-

Example:
-
- - - - - +

Example

+
<example>
+ + +
+; TFormNormal example
+
+Graphics3D 640, 480
+
+; Just a quick demonstration of the 'normalization' feature.
+
+TFormNormal 1,2,2, 0,0 ; transform from world to world
+
+; The transformation from world to world does nothing.
+; But afterward the vector (1,2,2) is divided by the length 3.
+
+message$ = "The normalized vector is ( "
+message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )"
+
+Text 70, 180, message
+
+Flip
+
+WaitKey()
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TFormPoint.htm b/_release/help/commands/3d_commands/TFormPoint.htm index a592bb0..c3ac993 100644 --- a/_release/help/commands/3d_commands/TFormPoint.htm +++ b/_release/help/commands/3d_commands/TFormPoint.htm @@ -1,97 +1,70 @@ -Command: TFormPoint - - +Blitz3D Docs + - - -

  TFormPoint  

- -

-Parameters:
-

- - -
x# - x co-ordinate on which to perform transformation
- y# - y co-ordinate on which to perform transformaion
- z# - z co-ordinate on which to perform transformation
- src_entity - source entity space from which to transform co-ordinates
- dest_entity - destination entity space to transform co-ordinates
+

TFormPoint x#, y#, z#, source_entity, dest_entity

+

Parameters

+ + + - +
+x#, y#, z# = coordinates of a point in 3d space
+
+source_entity = handle of source entity, or 0 for 3d world
+dest_entity = handle of destination entity, or 0 for 3d world
-

Description:
-
- - -
TFormPoint takes the co-ordinates of the source entity and 'transforms' them into co-ordinates relative to the co-ordinates of the destination entity (taking x, y and z as offsets, usually all set to 0 to use the center of the given entities). The resulting co-ordinates can be retrieved by the use of the TFormedX, TFormedY and TFormedZ functions. Passing 0 as either source or destination entity means that the transformation is performed relative to the global space (ie. the 3D world). -

-In English, this means that if you supply two entities, you can find the individual x, y and z offset distances of the source entity from the destination entity (providing you pass 0, 0, 0 as the x, y and z parameters). Changing the x, y and z parameters to anything other than zero will perform the transformation with this offset taken into account. For example, you can specify a point 5 units to the left of the given entities (x = 5), and the result will be offset by that x value. +

Description

+ + + - +
+Transforms between coordinate systems. After using TFormPoint the new
+coordinates can be read with TFormedX(), TFormedY() and TFormedZ().
+
+
+See EntityX() for details about local coordinates.
+
+Consider a sphere built with CreateSphere(). The 'north pole' is at (0,1,0).
+At first, local and global coordinates are the same. As the sphere is moved,
+turned and scaled the global coordinates of the point change.
+
+But it is always at (0,1,0) in the sphere's local space.
-

Example:
-
- - - -
- -Graphics3D 640, 480
-
-cam = CreateCamera ()
-MoveEntity cam, 5, 0, -5
-
-box = CreateCube ()
-MoveEntity box, 5, 0, 0
-
-Repeat
-
- If KeyDown (203) TurnEntity cam, 0, 0.5, 0
- If KeyDown (205) TurnEntity cam, 0, -0.5, 0
- If KeyDown (200) MoveEntity cam, 0, 0, 0.1
- If KeyDown (208) MoveEntity cam, 0, 0, -0.1
-
- bx# = EntityX (box)
- by# = EntityY (box)
- bz# = EntityZ (box)
-
- cx# = EntityX (cam, 1)
- cy# = EntityY (cam, 1)
- cz# = EntityZ (cam, 1)
-
- TFormPoint 0, 0, 0, cam, box
- xdist# = TFormedX ()
- ydist# = TFormedY ()
- zdist# = TFormedZ ()
-
- UpdateWorld
- RenderWorld
-
- Text 0, 20, "Box's global position"
- Text 20, 40, "x: " + bx
- Text 20, 60, "y: " + by
- Text 20, 80, "z: " + bz
-
- Text 0, 120, "Camera's global position"
- Text 20, 140, "x: " + cx
- Text 20, 160, "y: " + cy
- Text 20, 180, "z: " + cz
-
- Text 0, 220, "Camera position relative to box"
- Text 20, 240, "x: " + xdist
- Text 20, 260, "y: " + ydist
- Text 20, 280, "z: " + zdist
-
- Flip
-
-Until KeyHit (1)
-
-End
+

Example

+ + + - +
+; TFormPoint example
+
+Graphics3D 640, 480
+
+s = CreateSphere() ; center at (0,0,0) north pole at (0,1,0)
+
+MoveEntity s, 1,2,3 ; center at (1,2,3) north pole at (1,2+1,3)
+ScaleEntity s, 10,10,10 ; center at (1,2,3) north pole at (1,2+10,3)
+
+; Now verify that the north pole is at (1,12,3) in the 3d world
+
+TFormPoint 0,1,0, s,0 ; north pole transformed from sphere to world
+
+message$ = "North pole is at ( "
+message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )"
+
+Text 180, 200, message
+
+Flip
+
+WaitKey()
+End
- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TFormVector.htm b/_release/help/commands/3d_commands/TFormVector.htm index eb88067..17946c7 100644 --- a/_release/help/commands/3d_commands/TFormVector.htm +++ b/_release/help/commands/3d_commands/TFormVector.htm @@ -1,93 +1,90 @@ -Command: TFormVector - - +Blitz3D Docs + - - -

  TFormVector  

- -

-Parameters:
-

- - -
x# - x axis rotation on which to perform transformation
y# - y axis rotation on -which to perform transformaion
z# - z axis rotation on which to perform -transformation
src_entity - source entity space from which to transform -co-ordinates
dest_entity - destination entity space to transform co-ordinates +

TFormVector x#, y#, z#, source_entity, dest_entity

+

Parameters

+ + + - +
+x#, y#, z# = components of a vector in 3d space
+
+source_entity = handle of source entity, or 0 for 3d world
+dest_entity = handle of destination entity, or 0 for 3d world
-

Description:
-
- - -
TFormVector takes the source and destination entities (taking x, y and z as offset angles, usually all set to the source entity's orientation, ie. EntityPitch (src), EntityYaw (src) and EntityRoll (src)), and performs a transformation to determine the difference in orientation between source and destination entities. -

-The resulting offset angles for each axis can be retrieved by the use of the TFormedX, TFormedY and TFormedZ functions. +

Description

+ + + - +
+Transforms between coordinate systems. After using TFormVector the new
+components can be read with TFormedX(), TFormedY() and TFormedZ().
+
+
+See EntityX() for details about local coordinates.
+
+
+Similar to TFormPoint, but operates on a vector. A vector can be thought of
+as 'displacement relative to current location'.
+
+For example, vector (1,2,3) means one step to the right, two steps up
+and three steps forward.
+
+This is analogous to PositionEntity and MoveEntity:
+
+PositionEntity entity, x,y,z ; put entity at point (x,y,z)
+
+MoveEntity entity, x,y,z ; add vector (x,y,z) to current position
-

Example:
-
- - - - - +

Example

+
Graphics3D 640, 480
-
-cam = CreateCamera ()
-MoveEntity cam, 5, 0, -5
-
-box = CreateCube ()
-MoveEntity box, 5, 0, 0
- -Repeat
-
- If KeyDown (203) TurnEntity cam, 0, 0.5, 0
- If KeyDown (205) TurnEntity cam, 0, -0.5, 0
- If KeyDown (200) MoveEntity cam, 0, 0, 0.1
- If KeyDown (208) MoveEntity cam, 0, 0, -0.1
-
- bx# = EntityX (box)
- by# = EntityY (box)
- bz# = EntityZ (box)
-
- cx# = EntityX (cam, 1)
- cy# = EntityY (cam, 1)
- cz# = EntityZ (cam, 1)
-
- TFormVector EntityPitch (cam), EntityYaw (cam), EntityRoll (cam), cam, box
- xang# = TFormedX ()
- yang# = TFormedY ()
- zang# = TFormedZ ()
-
- UpdateWorld
- RenderWorld
-
- Text 0, 20, "Box's global position"
- Text 20, 40, "x: " + bx
- Text 20, 60, "y: " + by
- Text 20, 80, "z: " + bz
-
- Text 0, 120, "Camera's global position"
- Text 20, 140, "x: " + cx
- Text 20, 160, "y: " + cy
- Text 20, 180, "z: " + cz
-
- Text 0, 220, "Camera position relative to box"
- Text 20, 240, "x: " + xang
- Text 20, 260, "y: " + yang
- Text 20, 280, "z: " + zang
-
- Flip
-
-Until KeyHit (1)
-
-End
+ + +
+; TFormVector example
+
+Graphics3D 640, 480
+
+p = CreatePivot()
+
+PositionEntity p, 10, 20, 30 ; easy to visualize
+TurnEntity p, -5, -15, 25 ; hard to visualize
+
+; Question: what would happen if we took one step 'forward'?
+; The local vector corresponding to one step forward is (0,0,1)
+; in the pivot's local space. We need the global version.
+
+TFormVector 0,0,1, p,0 ; transform from pivot to world
+
+message$ = "'One step forward' vector is ( "
+message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )"
+
+Text 70, 180, message
+
+; Now actually take the step. The new location should be
+; (10,20,30) plus the vector we just computed.
+
+MoveEntity p, 0,0,1
+
+message$ = "New location of pivot is ( "
+message = message + EntityX(p) + ", "
+message = message + EntityY(p) + ", " + EntityZ(p) + " )"
+
+Text 100, 210, message
+
+Flip
+
+WaitKey()
+End +
- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TFormedX.htm b/_release/help/commands/3d_commands/TFormedX.htm index bc04870..348d5f0 100644 --- a/_release/help/commands/3d_commands/TFormedX.htm +++ b/_release/help/commands/3d_commands/TFormedX.htm @@ -1,51 +1,30 @@ -Command: TFormedX - - +Blitz3D Docs + - - -

  TFormedX  

- -

-Parameters:
-

- - - - -
n/a
-

Description:
-
- - - - -
Returns the resulting x offset of the last transformation function called: TFormPoint, TFormVector and TFormNormal.
-

Example (using TFormPoint):
-
- - - -
Graphics3D 640, 480

cam = CreateCamera ()
MoveEntity cam, 5, 0, --5

box = CreateCube ()
MoveEntity box, 5, 0, 0

Repeat

If -KeyDown (203) TurnEntity cam, 0, 0.5, 0
If KeyDown (205) TurnEntity cam, 0, --0.5, 0
If KeyDown (200) MoveEntity cam, 0, 0, 0.1
If KeyDown (208) -MoveEntity cam, 0, 0, -0.1

bx# = EntityX (box)
by# = EntityY -(box)
bz# = EntityZ (box)

cx# = EntityX (cam, 1)
cy# = EntityY -(cam, 1)
cz# = EntityZ (cam, 1)

TFormPoint 0, 0, 0, cam, box
xdist# -= TFormedX ()
ydist# = TFormedY ()
zdist# = TFormedZ -()

UpdateWorld
RenderWorld

Text 0, 20, "Box's global -position"
Text 20, 40, "x: " + bx
Text 20, 60, "y: " + by
Text 20, 80, -"z: " + bz

Text 0, 120, "Camera's global position"
Text 20, 140, "x: " -+ cx
Text 20, 160, "y: " + cy
Text 20, 180, "z: " + cz

Text 0, 220, -"Camera position relative to box"
Text 20, 240, "x: " + xdist
Text 20, -260, "y: " + ydist
Text 20, 280, "z: " + zdist

Flip

Until -KeyHit (1)

End +

TFormedX()

+

Parameters

+ + + - +
+None.
- +

Description

+ + + + +
+Returns the X component of the last TFormPoint, TFormVector or TFormNormal operation.
+
+See those commands for examples. +
+
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TFormedY.htm b/_release/help/commands/3d_commands/TFormedY.htm index b761d25..5ab997d 100644 --- a/_release/help/commands/3d_commands/TFormedY.htm +++ b/_release/help/commands/3d_commands/TFormedY.htm @@ -1,51 +1,30 @@ -Command: TFormedY - - +Blitz3D Docs + - - -

  TFormedY  

- -

-Parameters:
-

- - - - -
n/a
-

Description:
-
- - - - -
Returns the resulting y offset of the last transformation function called: TFormPoint, TFormVector and TFormNormal.
-

Example (using TFormPoint):
-
- - - -
Graphics3D 640, 480

cam = CreateCamera ()
MoveEntity cam, 5, 0, --5

box = CreateCube ()
MoveEntity box, 5, 0, 0

Repeat

If -KeyDown (203) TurnEntity cam, 0, 0.5, 0
If KeyDown (205) TurnEntity cam, 0, --0.5, 0
If KeyDown (200) MoveEntity cam, 0, 0, 0.1
If KeyDown (208) -MoveEntity cam, 0, 0, -0.1

bx# = EntityX (box)
by# = EntityY -(box)
bz# = EntityZ (box)

cx# = EntityX (cam, 1)
cy# = EntityY -(cam, 1)
cz# = EntityZ (cam, 1)

TFormPoint 0, 0, 0, cam, box
xdist# -= TFormedX ()
ydist# = TFormedY ()
zdist# = TFormedZ -()

UpdateWorld
RenderWorld

Text 0, 20, "Box's global -position"
Text 20, 40, "x: " + bx
Text 20, 60, "y: " + by
Text 20, 80, -"z: " + bz

Text 0, 120, "Camera's global position"
Text 20, 140, "x: " -+ cx
Text 20, 160, "y: " + cy
Text 20, 180, "z: " + cz

Text 0, 220, -"Camera position relative to box"
Text 20, 240, "x: " + xdist
Text 20, -260, "y: " + ydist
Text 20, 280, "z: " + zdist

Flip

Until -KeyHit (1)

End +

TFormedY()

+

Parameters

+ + + - +
+None.
- +

Description

+ + + + +
+Returns the Y component of the last TFormPoint, TFormVector or TFormNormal operation.
+
+See those commands for examples. +
+
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TFormedZ.htm b/_release/help/commands/3d_commands/TFormedZ.htm index df67871..d2ddc6b 100644 --- a/_release/help/commands/3d_commands/TFormedZ.htm +++ b/_release/help/commands/3d_commands/TFormedZ.htm @@ -1,51 +1,30 @@ -Command: TFormedZ - - +Blitz3D Docs + - - -

  TFormedZ  

- -

-Parameters:
-

- - - - -
n/a
-

Description:
-
- - - - -
Returns the resulting z offset of the last transformation function called: TFormPoint, TFormVector and TFormNormal.
-

Example (using TFormPoint):
-
- - - -
Graphics3D 640, 480

cam = CreateCamera ()
MoveEntity cam, 5, 0, --5

box = CreateCube ()
MoveEntity box, 5, 0, 0

Repeat

If -KeyDown (203) TurnEntity cam, 0, 0.5, 0
If KeyDown (205) TurnEntity cam, 0, --0.5, 0
If KeyDown (200) MoveEntity cam, 0, 0, 0.1
If KeyDown (208) -MoveEntity cam, 0, 0, -0.1

bx# = EntityX (box)
by# = EntityY -(box)
bz# = EntityZ (box)

cx# = EntityX (cam, 1)
cy# = EntityY -(cam, 1)
cz# = EntityZ (cam, 1)

TFormPoint 0, 0, 0, cam, box
xdist# -= TFormedX ()
ydist# = TFormedY ()
zdist# = TFormedZ -()

UpdateWorld
RenderWorld

Text 0, 20, "Box's global -position"
Text 20, 40, "x: " + bx
Text 20, 60, "y: " + by
Text 20, 80, -"z: " + bz

Text 0, 120, "Camera's global position"
Text 20, 140, "x: " -+ cx
Text 20, 160, "y: " + cy
Text 20, 180, "z: " + cz

Text 0, 220, -"Camera position relative to box"
Text 20, 240, "x: " + xdist
Text 20, -260, "y: " + ydist
Text 20, 280, "z: " + zdist

Flip

Until -KeyHit (1)

End +

TFormedZ()

+

Parameters

+ + + - +
+None.
- +

Description

+ + + + +
+Returns the Z component of the last TFormPoint, TFormVector or TFormNormal operation.
+
+See those commands for examples. +
+
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TerrainDetail.htm b/_release/help/commands/3d_commands/TerrainDetail.htm index c99bc1b..51d146f 100644 --- a/_release/help/commands/3d_commands/TerrainDetail.htm +++ b/_release/help/commands/3d_commands/TerrainDetail.htm @@ -1,119 +1,112 @@ -Command: TerrainDetail - - +Blitz3D Docs + - - -

  TerrainDetail -terrain,detail_level[,vertex_morph]  

- -

-Parameters:
-

- - - - +

TerrainDetail terrain,detail_level[,vertex_morph]

+

Parameters

+
terrain - terrain handle
- detail_level - detail level of terrain
- vertex_morph (optional) - true to enable vertex morphing of terrain. - Defaults to false.
+ + +
+terrain - terrain handle
+detail_level - detail level of terrain
+vertex_morph (optional) - True to enable vertex morphing of terrain. Defaults to False. +
-

Description:
-
- - - - +

Description

+
Sets the detail level for a terrain. This is the number of triangles - used to represent the terrain. A typical value is 2000.

The optional - vertex_morph parameter specifies whether to enable vertex morphing. It is - recommended you set this to true, as it will reduce the visibility of LOD - 'pop-in'.

-
+ + +
+Sets the detail level for a terrain. This is the number of triangles used to represent the terrain. A typical value is 2000.
+
+The optional vertex_morph parameter specifies whether to enable vertex morphing. It is recommended you set this to True, as it will reduce the visibility of LOD 'pop-in'. +
-

Example:
-
- - - - - +

Example

+
; TerrainDetail Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- ; Set terrain detail value
- terra_detail=4000
-
- ; Set vertex morph value
- vertex_morph=True
-
- While Not KeyDown( 1 )
-
- ; Change terrain detail value depending on key pressed
- If KeyDown(26) Then terra_detail=terra_detail-10
- If KeyDown(27) Then terra_detail=terra_detail+10
-
- ; Toggle vertex morphing on/off when spacebar is pressed
- If KeyHit(57)=True Then vertex_morph=1-vertex_morph
-
- ; Set terrain detail, vertex morphing
- TerrainDetail terrain,terra_detail,vertex_morph
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)+5
-
- PositionEntity camera,x#,terra_y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
- Text 0,20,"Use [ and ] keys to change terrain detail level"
- Text 0,40,"Press spacebar to enable/disable vertex morphing"
- Text 0,60,"Terrain Detail: "+terra_detail
- If vertex_morph=True Then Text 0,80,"Vertex Morphing: True" Else Text - 0,80,"Vertex Morphing: False"
-
- Flip
-
- Wend
-
- End
+ + +
+; TerrainDetail Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,1
+
+; Set terrain detail value
+terra_detail=4000
+
+; Set vertex morph value
+vertex_morph=True
+
+While Not KeyDown( 1 )
+
+; Change terrain detail value depending on key pressed
+If KeyDown(26) Then terra_detail=terra_detail-10
+If KeyDown(27) Then terra_detail=terra_detail+10
+
+; Toggle vertex morphing on/off when spacebar is pressed
+If KeyHit(57)=True Then vertex_morph=1-vertex_morph
+
+; Set terrain detail, vertex morphing
+TerrainDetail terrain,terra_detail,vertex_morph
+
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.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.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)+5
+
+PositionEntity camera,x#,terra_y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+Text 0,20,"Use [ and ] keys to change terrain detail level"
+Text 0,40,"Press spacebar to enable/disable vertex morphing"
+Text 0,60,"Terrain Detail: "+terra_detail
+If vertex_morph=True Then Text 0,80,"Vertex Morphing: True" Else Text 0,80,"Vertex Morphing: False"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TerrainHeight.htm b/_release/help/commands/3d_commands/TerrainHeight.htm index f71a00e..a3ffe5e 100644 --- a/_release/help/commands/3d_commands/TerrainHeight.htm +++ b/_release/help/commands/3d_commands/TerrainHeight.htm @@ -1,41 +1,109 @@ -Command: TerrainHeight - - +Blitz3D Docs + - - -

  TerrainHeight# ( terrain,grid_x,grid_z )  

- -

-Parameters:
-

- - - - +

TerrainHeight# ( terrain,grid_x,grid_z )

+

Parameters

+
terrain - terrain handle
- grid_x - grid x coordinate of terrain
- grid_z - grid z coordinate of terrain
+ + +
+terrain - terrain handle
+grid_x - grid x coordinate of terrain
+grid_z - grid z coordinate of terrain +
-

Description:
-
- - - - +

Description

+
Returns the height of the terrain at terrain grid coordinates x,z. The - value returned is in the range 0 to 1.

See also: - TerrainY.

+ + +
+Returns the height of the terrain at terrain grid coordinates x,z. The value returned is in the range 0 to 1.
+
+See also: TerrainY. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; TerrainHeight Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+terra_size=32 ; initial size of terrain, and no. of grids segments, along each side
+x_scale=10 ; x scale of terrain
+y_scale=50 ; y scale of terrain
+z_scale=10 ; z scale of terrain
+marker_x=terra_size/2 ; initial x position of marker
+marker_z=terra_size/2 ; initial z position of marker
+
+camera=CreateCamera()
+PositionEntity camera,(terra_size*x_scale)/2,50,0 ; position wherever; just try and get good view of terrain!
+RotateEntity camera,30,0,0 ; again, try and get good view of terrain
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Create terrain
+terra=CreateTerrain(terra_size)
+ScaleEntity terra,x_scale,y_scale,z_scale
+
+; Texture terrain
+grass_tex=LoadTexture("media/mossyground.bmp")
+EntityTexture terra,grass_tex
+
+; Create marker
+marker=CreateSphere()
+ScaleEntity marker,1,1,1
+EntityColor marker,255,0,0
+
+While Not KeyDown(1)
+
+; Change marker position values depending on cursor key pressed
+If KeyHit(205)=True Then marker_x=marker_x+1
+If KeyHit(203)=True Then marker_x=marker_x-1
+If KeyHit(208)=True Then marker_z=marker_z-1
+If KeyHit(200)=True Then marker_z=marker_z+1
+
+; Get terrain height at marker position
+marker_y#=TerrainHeight(terra,marker_x,marker_z)
+
+; If A pressed then increase marker_y value and modify terrain
+If KeyDown(30)=True
+If marker_y#<1 Then marker_y#=marker_y#+0.005
+ModifyTerrain terra,marker_x,marker_z,marker_y#
+EndIf
+
+; If Z pressed then decrease marker_y value and modify terrain
+If KeyDown(44)=True
+If marker_y#>0 Then marker_y#=marker_y#-0.005
+ModifyTerrain terra,marker_x,marker_z,marker_y#
+EndIf
+
+; Position marker, taking into account x, y and z scales of terrain
+PositionEntity marker,marker_x*x_scale,marker_y#*y_scale,marker_z*z_scale
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move marker over the terrain"
+Text 0,20,"Press A or Z to alter height of terrain at marker's position"
+Text 0,40,"Terrain Height: "+marker_y#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TerrainShading.htm b/_release/help/commands/3d_commands/TerrainShading.htm index d78f21e..9aed1c4 100644 --- a/_release/help/commands/3d_commands/TerrainShading.htm +++ b/_release/help/commands/3d_commands/TerrainShading.htm @@ -1,106 +1,102 @@ -Command: TerrainShading - - +Blitz3D Docs + - - -

  TerrainShading terrain,enable  

- -

-Parameters:
-

- - - - +

TerrainShading terrain,enable

+

Parameters

+
terrain - terrain handle
- enable - true to enable terrain shading, false to to disable it.
+ + +
+terrain - terrain handle
+enable - True to enable terrain shading, False to to disable it. The default mode is False. +
-

Description:
-
- - - - +

Description

+
Enables or disables terrain shading.

Shaded terrains are a little - slower than non-shaded terrains, and in some instances can increase the - visibility of LOD 'pop-in'. However, the option is there to have shaded - terrains if you wish to do so.

-

Terrain shading is disabled by default.

+ + +
+Enables or disables terrain shading.
+
+Shaded terrains are a little slower than non-shaded terrains, and in some instances can increase the visibility of LOD 'pop-in'. However, the option is there to have shaded terrains if you wish to do so. +
-

Example:
-
- - - - - +

Example

+
; TerrainShading Example
- ; ----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,45,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Set terrain detail, enable vertex morphing
- TerrainDetail terrain,4000,True
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- While Not KeyDown( 1 )
-
- ; Toggle terrain shading value between 0 and 1 when spacebar is pressed
- If KeyHit(57)=True Then terra_shade=1-terra_shade
-
- ; Enable/disable terrain shading
- TerrainShading terrain,terra_shade
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)+5
-
- PositionEntity camera,x#,terra_y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
- Text 0,20,"Press spacebar to toggle between TerrainShading True/False"
- If terra_shade=True Then Text 0,40,"TerrainShading: True" Else Text - 0,40,"TerrainShading: False"
-
- Flip
-
- Wend
-
- End
+ + +
+; TerrainShading Example
+; ----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,45,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Set terrain detail, enable vertex morphing
+TerrainDetail terrain,4000,True
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,1
+
+While Not KeyDown( 1 )
+
+; Toggle terrain shading value between 0 and 1 when spacebar is pressed
+If KeyHit(57)=True Then terra_shade=1-terra_shade
+
+; Enable/disable terrain shading
+TerrainShading terrain,terra_shade
+
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.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.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)+5
+
+PositionEntity camera,x#,terra_y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+Text 0,20,"Press spacebar to toggle between TerrainShading True/False"
+If terra_shade=True Then Text 0,40,"TerrainShading: True" Else Text 0,40,"TerrainShading: False"
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TerrainSize.htm b/_release/help/commands/3d_commands/TerrainSize.htm index f18daa6..c4801b9 100644 --- a/_release/help/commands/3d_commands/TerrainSize.htm +++ b/_release/help/commands/3d_commands/TerrainSize.htm @@ -1,95 +1,94 @@ -Command: TerrainSize - - +Blitz3D Docs + - - -

  TerrainSize ( terrain )  

- -

-Parameters:
-

- - - - +

TerrainSize ( terrain )

+

Parameters

+
terrain - terrain handle
+ + +
+terrain - terrain handle +
-

Description:
-
- - - - +

Description

+
Returns the grid size used to create a terrain.
+ + +
+Returns the grid size used to create a terrain. +
-

Example:
-
- - - - - +

Example

+
; TerrainSize Example
- ; -------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Set terrain detail, enable vertex morphing
- TerrainDetail terrain,4000,True
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- While Not KeyDown( 1 )
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)+5
-
- PositionEntity camera,x#,terra_y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
-
- ; Output terrain size to screen
- Text 0,20,"Terrain Size: "+TerrainSize(terrain)
-
- Flip
-
- Wend
-
- End
+ + +
+; TerrainSize Example
+; -------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Set terrain detail, enable vertex morphing
+TerrainDetail terrain,4000,True
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,1
+
+While Not KeyDown( 1 )
+
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.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.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)+5
+
+PositionEntity camera,x#,terra_y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+
+; Output terrain size to screen
+Text 0,20,"Terrain Size: "+TerrainSize(terrain)
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TerrainX.htm b/_release/help/commands/3d_commands/TerrainX.htm index eca444a..0d9a54e 100644 --- a/_release/help/commands/3d_commands/TerrainX.htm +++ b/_release/help/commands/3d_commands/TerrainX.htm @@ -1,100 +1,99 @@ -Command: TerrainX - - +Blitz3D Docs + - - -

  TerrainX# (terrain,x#,y#,z# )  

- -

-Parameters:
-

- - - - +

TerrainX# (terrain,x#,y#,z# )

+

Parameters

+
terrain - terrain handle
- x# - world x coordinate
- y# - world y coordinate
- z# - world z coordinate
+ + +
+terrain - terrain handle
+x# - world x coordinate
+y# - world y coordinate
+z# - world z coordinate +
-

Description:
-
- - - - +

Description

+
Returns the interpolated x coordinate on a terrain.

See also: - TerrainY, - TerrainZ.

+ + +
+Returns the interpolated x coordinate on a terrain.
+
+See also: TerrainY, TerrainZ. +
-

Example:
-
- - - - - +

Example

+
; TerrainX Example
- ; ----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- ; Set terrain detail, enable vertex morphing
- TerrainDetail terrain,4000,True
-
- While Not KeyDown( 1 )
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)+5
-
- PositionEntity camera,x#,terra_y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
-
- ; Output TerrainX value to screen
- Text 0,20,"TerrainX: "+TerrainX(terrain,x#,terra_y#,z#)
-
- Flip
-
- Wend
-
- End
+ + +
+; TerrainX Example
+; ----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,1
+
+; Set terrain detail, enable vertex morphing
+TerrainDetail terrain,4000,True
+
+While Not KeyDown( 1 )
+
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.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.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)+5
+
+PositionEntity camera,x#,terra_y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+
+; Output TerrainX value to screen
+Text 0,20,"TerrainX: "+TerrainX(terrain,x#,terra_y#,z#)
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TerrainY.htm b/_release/help/commands/3d_commands/TerrainY.htm index 2da3b8d..d57b4df 100644 --- a/_release/help/commands/3d_commands/TerrainY.htm +++ b/_release/help/commands/3d_commands/TerrainY.htm @@ -1,101 +1,101 @@ -Command: TerrainY - - +Blitz3D Docs + - - -

  TerrainY# (terrain,x#,y#,z# )  

- -

-Parameters:
-

- - - - +

TerrainY# (terrain,x#,y#,z# )

+

Parameters

+
terrain - terrain handle
- x# - world x coordinate
- y# - world y coordinate
- z# - world z coordinate
+ + +
+terrain - terrain handle
+x# - world x coordinate
+y# - world y coordinate
+z# - world z coordinate +
-

Description:
-
- - - - +

Description

+
Returns the interpolated y coordinate on a terrain.

Gets the ground's - height, basically.

See also: TerrainX, - TerrainZ, - TerrainHeight.

+ + +
+Returns the interpolated y coordinate on a terrain.
+
+Gets the ground's height, basically.
+
+See also: TerrainX, TerrainZ, TerrainHeight. +
-

Example:
-
- - - - - +

Example

+
; TerrainY Example
- ; ----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- ; Set terrain detail, enable vertex morphing
- TerrainDetail terrain,4000,True
-
- While Not KeyDown( 1 )
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)
-
- PositionEntity camera,x#,terra_y#+5,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
-
- ; Output TerrainY value to screen
- Text 0,20,"TerrainY: "+terra_y#
-
- Flip
-
- Wend
-
- End
+ + +
+; TerrainY Example
+; ----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,1
+
+; Set terrain detail, enable vertex morphing
+TerrainDetail terrain,4000,True
+
+While Not KeyDown( 1 )
+
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.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.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)
+
+PositionEntity camera,x#,terra_y#+5,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+
+; Output TerrainY value to screen
+Text 0,20,"TerrainY: "+terra_y#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TerrainZ.htm b/_release/help/commands/3d_commands/TerrainZ.htm index 81ae38a..82afe7c 100644 --- a/_release/help/commands/3d_commands/TerrainZ.htm +++ b/_release/help/commands/3d_commands/TerrainZ.htm @@ -1,99 +1,99 @@ -Command: TerrainZ - - +Blitz3D Docs + - - -

  TerrainZ# (terrain,x#,y#,z# )  

- -

-Parameters:
-

- - - - +

TerrainZ# (terrain,x#,y#,z# )

+

Parameters

+
terrain - terrain handle
- x# - world x coordinate
- y# - world y coordinate
- z# - world z coordinate
+ + +
+terrain - terrain handle
+x# - world x coordinate
+y# - world y coordinate
+z# - world z coordinate +
-

Description:
-
- - - - +

Description

+
Returns the interpolated z coordinate on a terrain.

See also: TerrainX, - TerrainY.

+ + +
+Returns the interpolated z coordinate on a terrain.
+
+See also: TerrainX, TerrainY. +
-

Example:
-
- - - - - +

Example

+
; TerrainZ Example
- ; ----------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- PositionEntity camera,1,1,1
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- ; Load terrain
- terrain=LoadTerrain( "media/height_map.bmp" )
-
- ; Scale terrain
- ScaleEntity terrain,1,50,1
-
- ; Texture terrain
- grass_tex=LoadTexture( "media/mossyground.bmp" )
- EntityTexture terrain,grass_tex,0,1
-
- ; Set terrain detail, enable vertex morphing
- TerrainDetail terrain,4000,True
-
- While Not KeyDown( 1 )
-
- If KeyDown( 203 )=True Then x#=x#-0.1
- If KeyDown( 205 )=True Then x#=x#+0.1
- If KeyDown( 208 )=True Then y#=y#-0.1
- If KeyDown( 200 )=True Then y#=y#+0.1
- If KeyDown( 44 )=True Then z#=z#-0.1
- If KeyDown( 30 )=True Then z#=z#+0.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.1
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
-
- x#=EntityX(camera)
- y#=EntityY(camera)
- z#=EntityZ(camera)
-
- terra_y#=TerrainY(terrain,x#,y#,z#)+5
-
- PositionEntity camera,x#,terra_y#,z#
-
- RenderWorld
-
- Text 0,0,"Use cursor keys to move about the terrain"
-
- ; Output TerrainZ value to screen
- Text 0,20,"TerrainZ: "+TerrainZ(terrain,x#,terra_y#,z#)
-
- Flip
-
- Wend
-
- End
+ + +
+; TerrainZ Example
+; ----------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+PositionEntity camera,1,1,1
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+; Load terrain
+terrain=LoadTerrain( "media/height_map.bmp" )
+
+; Scale terrain
+ScaleEntity terrain,1,50,1
+
+; Texture terrain
+grass_tex=LoadTexture( "media/mossyground.bmp" )
+EntityTexture terrain,grass_tex,0,1
+
+; Set terrain detail, enable vertex morphing
+TerrainDetail terrain,4000,True
+
+While Not KeyDown( 1 )
+
+If KeyDown( 203 )=True Then x#=x#-0.1
+If KeyDown( 205 )=True Then x#=x#+0.1
+If KeyDown( 208 )=True Then y#=y#-0.1
+If KeyDown( 200 )=True Then y#=y#+0.1
+If KeyDown( 44 )=True Then z#=z#-0.1
+If KeyDown( 30 )=True Then z#=z#+0.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.1
+If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1
+
+x#=EntityX(camera)
+y#=EntityY(camera)
+z#=EntityZ(camera)
+
+terra_y#=TerrainY(terrain,x#,y#,z#)+5
+
+PositionEntity camera,x#,terra_y#,z#
+
+RenderWorld
+
+Text 0,0,"Use cursor keys to move about the terrain"
+
+; Output TerrainZ value to screen
+Text 0,20,"TerrainZ: "+TerrainZ(terrain,x#,terra_y#,z#)
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TextureBlend.htm b/_release/help/commands/3d_commands/TextureBlend.htm index 8f96be2..2cf9976 100644 --- a/_release/help/commands/3d_commands/TextureBlend.htm +++ b/_release/help/commands/3d_commands/TextureBlend.htm @@ -1,44 +1,124 @@ -Command: TextureBlend - - +Blitz3D Docs + - - -

  TextureBlend texture,blend  

- -

-Parameters:
-

- - - - +

TextureBlend Texture, Blend

+

Parameters

+
texture - name of texture
-
- blend - blend mode of texture
- 0: disable texture
- 1: alpha
- 2: multiply (default)
- 3: add
+ + +
+Texture - Texture handle.
+Blend - Blend mode of texture.
+
+0: Do not blend
+1: No blend, or Alpha (alpha when texture loaded with alpha flag - not recommended for multitexturing - see below)
+2: Multiply (default)
+3: Add
+4: Dot3
+5: Multiply 2 +
-

Description:
-
- - - - +

Description

+
Set the blending mode for a texture.

This is used with multitexturing - to control how the texture is combined with other textures.

+ + +
+Sets the blending mode for a texture.
+
+The texture blend mode determines how the texture will blend with the texture or polygon which is 'below' it. Texture 0 will blend with the polygons of the entity it is applied to. Texture 1 will blend with texture 0. Texture 2 will blend with texture 1. And so on.
+
+Texture blending in Blitz effectively takes the highest order texture (the one with the highest index) and it blends with the texture below it, then that result to the texture directly below again, and so on until texture 0 which is blended with the polygons of the entity it is applied to and thus the world, depending on the EntityBlend of the object.
+
+Each of the blend modes are identical to their EntityBlend counterparts.
+
+In the case of multitexturing (more than one texture applied to an entity), it is not recommended you blend textures that have been loaded with the alpha flag, as this can cause unpredictable results on a variety of different graphics cards.
+
+Use EntityTexture to set the index number of a texture. +
+
+See also: EntityBlend, EntityTexture. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; TextureBlend Example
+; --------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+; Choose a background colour which isn't the same colour as anything else, to avoid confusion
+CameraClsColor camera,255,0,0
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Load textures
+tex0=LoadTexture( "media/b3dlogo.jpg" )
+tex1=LoadTexture( "media/chorme-2.bmp" )
+
+; Texture cube with textures
+EntityTexture cube,tex0,0,0
+EntityTexture cube,tex1,0,1
+
+tex0_blend_info$="no texture"
+tex1_blend_info$="no texture"
+
+While Not KeyDown( 1 )
+
+; Change texture 0 blending mode
+If KeyHit( 11 )=True
+tex0_blend=tex0_blend+1
+If tex0_blend=4 Then tex0_blend=0
+If tex0_blend=0 Then tex0_blend_info$="no texture"
+If tex0_blend=1 Then tex0_blend_info$="no blend"
+If tex0_blend=2 Then tex0_blend_info$="multiply"
+If tex0_blend=3 Then tex0_blend_info$="add"
+EndIf
+
+; Change texture 1 blending mode
+If KeyHit( 2 )=True
+tex1_blend=tex1_blend+1
+If tex1_blend=4 Then tex1_blend=0
+If tex1_blend=0 Then tex1_blend_info$="no texture"
+If tex1_blend=1 Then tex1_blend_info$="no blend"
+If tex1_blend=2 Then tex1_blend_info$="multiply"
+If tex1_blend=3 Then tex1_blend_info$="add"
+EndIf
+
+; Set texture blend modes
+TextureBlend tex0,tex0_blend
+TextureBlend tex1,tex1_blend
+
+TurnEntity cube,0.1,0.1,0.1
+
+RenderWorld
+
+Text 0,0,"Press 0 to change texture 0's blending mode"
+Text 0,20,"Press 1 to change texture 1's blending mode"
+Text 0,40,"TextureBlend tex0,"+tex0_blend+" ("+tex0_blend_info$+")"
+Text 0,60,"TextureBlend tex1,"+tex1_blend+" ("+tex1_blend_info$+")"
+
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TextureBuffer.htm b/_release/help/commands/3d_commands/TextureBuffer.htm index 2af1e5c..983abf2 100644 --- a/_release/help/commands/3d_commands/TextureBuffer.htm +++ b/_release/help/commands/3d_commands/TextureBuffer.htm @@ -1,108 +1,101 @@ -Command: TextureBuffer - - +Blitz3D Docs + - - -

  TextureBuffer ( texture[,frame] )  

- -

-Parameters:
-

- - - - +

TextureBuffer ( texture[,frame] )

+

Parameters

+
texture - texture handle
- frame (optional) - texture frame
+ + +
+texture - texture handle
+frame (optional) - texture frame +
-

Description:
-
- - - - +

Description

+
Returns the handle of a texture's drawing buffer.

This can be used - with SetBuffer to perform 2D drawing operations to - the texture, - although it's usually faster to draw to an image, and then copy the - image buffer across to the texture buffer using - CopyRect.

-

You cannot render 3D to a texture buffer; 3D can only be rendered to the - back buffer. To display 3D graphics on a texture, use - CopyRect to copy the contents of - the back buffer to a texture buffer.

-
+ + +
+Returns the handle of a texture's drawing buffer.
+
+This can be used with SetBuffer to perform 2D drawing operations to the texture, although it's usually faster to draw to an image, and then copy the image buffer across to the texture buffer using CopyRect.
+
+You cannot render 3D to a texture buffer; 3D can only be rendered to the back buffer. To display 3D graphics on a texture, use CopyRect to copy the contents of the back buffer to a texture buffer. +
-

Example:
-
- - - - - +

Example

+
; TextureBuffer Example
- ; ---------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- cube=CreateCube()
- PositionEntity cube,0,0,5
-
- ; Create texture of size 256x256
- tex=CreateTexture(256,256)
-
- ; Set buffer - texture buffer
- SetBuffer TextureBuffer(tex)
-
- ; Clear texture buffer with background white color
- ClsColor 255,255,255
- Cls
-
- ; Draw text on texture
- font=LoadFont("arial",24)
- SetFont font
- Color 0,0,0
- Text 0,0,"This texture"
- Text 0,40,"was created using" : Color 0,0,255
- Text 0,80,"CreateTexture()" : Color 0,0,0
- Text 0,120,"and drawn to using" : Color 0,0,255
- Text 0,160,"SetBuffer TextureBuffer()"
-
- ; Texture cube with texture
- EntityTexture cube,tex
-
- ; Set buffer - backbuffer
- SetBuffer BackBuffer()
-
- While Not KeyDown( 1 )
-
- pitch#=0
- yaw#=0
- roll#=0
-
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- TurnEntity cube,pitch#,yaw#,roll#
-
- RenderWorld
- Flip
-
- Wend
-
- End
+ + +
+; TextureBuffer Example
+; ---------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+cube=CreateCube()
+PositionEntity cube,0,0,5
+
+; Create texture of size 256x256
+tex=CreateTexture(256,256)
+
+; Set buffer - texture buffer
+SetBuffer TextureBuffer(tex)
+
+; Clear texture buffer with background white color
+ClsColor 255,255,255
+Cls
+
+; Draw text on texture
+font=LoadFont("arial",24)
+SetFont font
+Color 0,0,0
+Text 0,0,"This texture"
+Text 0,40,"was created using" : Color 0,0,255
+Text 0,80,"CreateTexture()" : Color 0,0,0
+Text 0,120,"and drawn to using" : Color 0,0,255
+Text 0,160,"SetBuffer TextureBuffer()"
+
+; Texture cube with texture
+EntityTexture cube,tex
+
+; Set buffer - backbuffer
+SetBuffer BackBuffer()
+
+While Not KeyDown( 1 )
+
+pitch#=0
+yaw#=0
+roll#=0
+
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+TurnEntity cube,pitch#,yaw#,roll#
+
+RenderWorld
+Flip
+
+Wend
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TextureCoords.htm b/_release/help/commands/3d_commands/TextureCoords.htm index 19cfaab..6fecc55 100644 --- a/_release/help/commands/3d_commands/TextureCoords.htm +++ b/_release/help/commands/3d_commands/TextureCoords.htm @@ -1,41 +1,33 @@ -Command: TextureCoords - - +Blitz3D Docs + - - -

  TextureCoords texture,coords  

- -

-Parameters:
-

- - - - +

TextureCoords texture,coords

+

Parameters

+
texture - name of texture
- coords -
- 0: UV coordinates are from first UV set in vertices (default)
- 1: UV coordinates are from second UV set in vertices
+ + +
+texture - name of texture
+coords -
+0: UV coordinates are from first UV set in vertices (default)
+1: UV coordinates are from second UV set in vertices +
-

Description:
-
- - - - +

Description

+
Sets the texture coordinate mode for a texture.

This determines where - the UV values used to look up a texture come from.

+ + +
+Sets the texture coordinate mode for a texture.
+
+This determines where the UV values used to look up a texture come from. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TextureFilter.htm b/_release/help/commands/3d_commands/TextureFilter.htm index 297f4ef..9a26258 100644 --- a/_release/help/commands/3d_commands/TextureFilter.htm +++ b/_release/help/commands/3d_commands/TextureFilter.htm @@ -1,45 +1,107 @@ -Command: TextureFilter - - +Blitz3D Docs + - - -

  TextureFilter match_text$,flags  

- -

-Parameters:
-

- - - - +

TextureFilter match_text$,flags

+

Parameters

+
match_text$ - text that, if found in texture filename, will activate - certain filters
- flags - filter flags
+ + +
+match_text$ - text that, if found in texture filename, will activate certain filters
+
+flags - filter texture flags:
+1: Color
+2: Alpha
+4: Masked
+8: Mipmapped
+16: Clamp U
+32: Clamp V
+64: Spherical reflection map
+128:
+256: Store texture in vram
+512: Force the use of high color textures +
-

Description:
-
- - - - +

Description

+
Adds a texture filter. Any textures loaded that contain the text - specified by match_text$ will have the provided flags added.

This is - mostly of use when loading a mesh.

-

By default, the following texture filter is used:

-

TextureFilter "",1+8

-

This means that all loaded textures will have color and be mipmapped by - default.

+ + +
+Adds a texture filter. Any textures loaded that contain the text specified by match_text$ will have the provided flags added.
+
+This is mostly of use when loading a mesh.
+
+By default, the following texture filter is used:
+
+TextureFilter "",1+8
+
+This means that all loaded textures will have color and be mipmapped by default. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; 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

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TextureHeight.htm b/_release/help/commands/3d_commands/TextureHeight.htm index 3a7482b..35b3cd0 100644 --- a/_release/help/commands/3d_commands/TextureHeight.htm +++ b/_release/help/commands/3d_commands/TextureHeight.htm @@ -1,37 +1,68 @@ -Command: TextureHeight - - +Blitz3D Docs + - - -

  TextureHeight ( texture )  

- -

-Parameters:
-

- - - - +

TextureHeight ( texture )

+

Parameters

+
texture - texture handle
+ + +
+texture - texture handle +
-

Description:
-
- - - - +

Description

+
Returns the height of a texture.
+ + +
+Returns the height of a texture. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; TextureWidth and TextureHeight Example.
+; ---------------------------------------
+
+Graphics3D 640,480
+
+; This bit of code creates 4 textures
+; of different sizes and shapes.
+
+texture1=CreateTexture(256,256,59)
+texture2=CreateTexture(256,128,59)
+texture3=CreateTexture(128,256,59)
+texture4=CreateTexture(200,200,59)
+
+; The following lines print the selected value
+; of the texture, and reports the actual texture
+; resolution.
+
+
+Print "Texture 1 was created at 256x256"
+Print "On your system the dimensions are "+TextureWidth(texture1)+"x"+TextureHeight(texture1)
+Print
+Print "Texture 2 was created at 256x128"
+Print "On your system the dimensions are "+TextureWidth(texture2)+"x"+TextureHeight(texture2)
+Print
+Print "Texture 3 was created at 128x256"
+Print "On your system the dimensions are "+TextureWidth(texture3)+"x"+TextureHeight(texture3)
+Print
+Print "Texture 4 was created at 200x200"
+Print "On your system the dimensions are "+TextureWidth(texture4)+"x"+TextureHeight(texture4)
+
+WaitKey
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TextureWidth.htm b/_release/help/commands/3d_commands/TextureWidth.htm index 0552a58..3718478 100644 --- a/_release/help/commands/3d_commands/TextureWidth.htm +++ b/_release/help/commands/3d_commands/TextureWidth.htm @@ -1,37 +1,68 @@ -Command: TextureWidth - - +Blitz3D Docs + - - -

  TextureWidth (texture )  

- -

-Parameters:
-

- - - - +

TextureWidth (texture )

+

Parameters

+
texture - texture handle
+ + +
+texture - texture handle +
-

Description:
-
- - - - +

Description

+
Returns the width of a texture.
+ + +
+Returns the width of a texture. +
-

Example:
-
- - - - - +

Example

+
None.
+ + +
+; TextureWidth and TextureHeight Example.
+; ---------------------------------------
+
+Graphics3D 640,480
+
+; This bit of code creates 4 textures
+; of different sizes and shapes.
+
+texture1=CreateTexture(256,256,59)
+texture2=CreateTexture(256,128,59)
+texture3=CreateTexture(128,256,59)
+texture4=CreateTexture(200,200,59)
+
+; The following lines print the selected value
+; of the texture, and reports the actual texture
+; resolution.
+
+
+Print "Texture 1 was created at 256x256"
+Print "On your system the dimensions are "+TextureWidth(texture1)+"x"+TextureHeight(texture1)
+Print
+Print "Texture 2 was created at 256x128"
+Print "On your system the dimensions are "+TextureWidth(texture2)+"x"+TextureHeight(texture2)
+Print
+Print "Texture 3 was created at 128x256"
+Print "On your system the dimensions are "+TextureWidth(texture3)+"x"+TextureHeight(texture3)
+Print
+Print "Texture 4 was created at 200x200"
+Print "On your system the dimensions are "+TextureWidth(texture4)+"x"+TextureHeight(texture4)
+
+WaitKey
+
+End +
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/TranslateEntity.htm b/_release/help/commands/3d_commands/TranslateEntity.htm index c4a72d6..6a55c95 100644 --- a/_release/help/commands/3d_commands/TranslateEntity.htm +++ b/_release/help/commands/3d_commands/TranslateEntity.htm @@ -1,103 +1,94 @@ -Command: TranslateEntity - - +Blitz3D Docs + - - -

  TranslateEntity entity,x#,y#,z#,[,global]  

- -

-Parameters:
-

- - - - +

TranslateEntity entity,x#,y#,z#,[,global]

+

Parameters

+
entity - name of entity to be translated
-x# - x amount that entity will be translated by
-y# - y amount that entity will be translated by
-z# - z amount that entity will be translated by
-global (optional) -
+ + +
+entity - name of entity to be translated
+x# - x amount that entity will be translated by
+y# - y amount that entity will be translated by
+z# - z amount that entity will be translated by
+global (optional) - +
-

Description:
-
- - -
Translates an entity relative to its current position and not its - -orientation.
+

Description

+ + + - +
+See also: MoveEntity, PositionEntity, PositionMesh. + +
+Translates an entity relative to its current position and not its orientation.
+
+What this means is that an entity will move in a certain direction despite where it may be facing. Imagine that you have a game character that you want to make jump in the air at the same time as doing a triple somersault. Translating the character by a positive y amount will mean the character will always travel directly up in their air, regardless of where it may be facing due to the somersault action.
-What this means is that an entity will move in a certain direction despite where -it may be facing. Imagine that you have a game character that -you want to make jump in the air at the same time as doing a triple somersault. -Translating the character by a positive y amount will mean the character will -always travel directly up in their air, regardless of where it may be facing due -to the somersault action.

See also: MoveEntity, - PositionEntity.

-

Example:
-
- - - - - +

Example

+
; TranslateEntity Example
- ; -----------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
-
- ; Rotate cone by random amount to demonstrate that TranslateEntity is - independent of entity orientation
- RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 )
-
- ; Translate cone in front of camera, so we can see it to begin with
- TranslateEntity cone,0,0,10
-
- While Not KeyDown( 1 )
-
- ; Reset translation values - otherwise, the cone will not stop!
- x#=0
- y#=0
- z#=0
-
- ; Change translation values depending on the key pressed
- If KeyDown( 203 )=True Then x#=-0.1
- If KeyDown( 205 )=True Then x#=0.1
- If KeyDown( 208 )=True Then y#=-0.1
- If KeyDown( 200 )=True Then y#=0.1
- If KeyDown( 44 )=True Then z#=-0.1
- If KeyDown( 30 )=True Then z#=0.1
-
- ; Translate sphere using translation values
- TranslateEntity cone,x#,y#,z#
-
- ; If spacebar pressed then rotate cone by random amount
- If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( - 0,360 )
-
- RenderWorld
-
- Text 0,0,"Use cursor/A/Z keys to translate cone, spacebar to rotate cone by - random amount"
- Text 0,20,"X Translation: "+x#
- Text 0,40,"Y Translation: "+y#
- Text 0,60,"Z Translation: "+z#
-
- Flip
-
- Wend
-
- End
+ + +
+; TranslateEntity Example
+; -----------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+
+; Rotate cone by random amount to demonstrate that TranslateEntity is independent of entity orientation
+RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 )
+
+; Translate cone in front of camera, so we can see it to begin with
+TranslateEntity cone,0,0,10
+
+While Not KeyDown( 1 )
+
+; Reset translation values - otherwise, the cone will not stop!
+x#=0
+y#=0
+z#=0
+
+; Change translation values depending on the key pressed
+If KeyDown( 203 )=True Then x#=-0.1
+If KeyDown( 205 )=True Then x#=0.1
+If KeyDown( 208 )=True Then y#=-0.1
+If KeyDown( 200 )=True Then y#=0.1
+If KeyDown( 44 )=True Then z#=-0.1
+If KeyDown( 30 )=True Then z#=0.1
+
+; Translate sphere using translation values
+TranslateEntity cone,x#,y#,z#
+
+; If spacebar pressed then rotate cone by random amount
+If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 )
+
+RenderWorld
+
+Text 0,0,"Use cursor/A/Z keys to translate cone, spacebar to rotate cone by random amount"
+Text 0,20,"X Translation: "+x#
+Text 0,40,"Y Translation: "+y#
+Text 0,60,"Z Translation: "+z#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/TriangleVertex.htm b/_release/help/commands/3d_commands/TriangleVertex.htm index 7e0a41b..e144952 100644 --- a/_release/help/commands/3d_commands/TriangleVertex.htm +++ b/_release/help/commands/3d_commands/TriangleVertex.htm @@ -1,40 +1,30 @@ -Command: TriangleVertex - - +Blitz3D Docs + - - -

  TriangleVertex ( -surface,triangle_index,corner )  

- -

-Parameters:
-

- - - - +

TriangleVertex ( surface,triangle_index,corner )

+

Parameters

+
surface - surface handle
- triangle_index - triangle index
- corner - corner of triangle. Should be 0, 1 or 2.
+ + +
+surface - surface handle
+triangle_index - triangle index
+corner - corner of triangle. Should be 0, 1 or 2. +
-

Description:
-
- - - - +

Description

+
Returns the vertex of a triangle corner.
+ + +
+Returns the vertex of a triangle corner. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/TurnEntity.htm b/_release/help/commands/3d_commands/TurnEntity.htm index 7bb92e5..c59e851 100644 --- a/_release/help/commands/3d_commands/TurnEntity.htm +++ b/_release/help/commands/3d_commands/TurnEntity.htm @@ -1,91 +1,90 @@ -Command: TurnEntity - - +Blitz3D Docs + - - -

  TurnEntity entity,pitch#,yaw#,roll#,[,global]  

- -

-Parameters:
-

- - - - +

TurnEntity entity,pitch#,yaw#,roll#,[,global]

+

Parameters

+
entity - name of entity to be rotated
-pitch# - angle in degrees that entity will be pitched
-yaw# - angle in degrees that entity will be yawed
-roll# - angle in degrees that entity will be rolled
-global (optional) -
+ + +
+entity - name of entity to be rotated
+pitch# - angle in degrees that entity will be pitched
+yaw# - angle in degrees that entity will be yawed
+roll# - angle in degrees that entity will be rolled
+global (optional) - +
-

Description:
-
- - -
Turns an entity relative to its current orientation.
+

Description

+ + + - +See also: RotateEntity, RotateMesh. + +
+Turns an entity relative to its current orientation.
+
+Pitch is the same as the x angle of an entity, and is equivalent to tilting forward/backwards.
+
+Yaw is the same as the y angle of an entity, and is equivalent to turning left/right.
+
+Roll is the same as the z angle of an entity, and is equivalent to tilting left/right.
-Pitch is the same as the x angle of an entity, and is equivalent to tilting -forward/backwards.

-Yaw is the same as the y angle of an entity, and is equivalent to turning -left/right.
-
-Roll is the same as the z angle of an entity, and is equivalent to tilting -left/right.

See also: RotateEntity.

-

Example:
-
- - - - - +

Example

+
; TurnEntity Example
- ; ------------------
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
- light=CreateLight()
-
- cone=CreateCone( 32 )
- PositionEntity cone,0,0,5
-
- While Not KeyDown( 1 )
-
- ; Reset turn values - otherwise, the cone will not stop turning!
- pitch#=0
- yaw#=0
- roll#=0
-
- ; Change movement values depending on the key pressed
- If KeyDown( 208 )=True Then pitch#=-1
- If KeyDown( 200 )=True Then pitch#=1
- If KeyDown( 203 )=True Then yaw#=-1
- If KeyDown( 205 )=True Then yaw#=1
- If KeyDown( 45 )=True Then roll#=-1
- If KeyDown( 44 )=True Then roll#=1
-
- ; Move sphere using movement values
- TurnEntity cone,pitch#,yaw#,roll#
-
- RenderWorld
-
- Text 0,0,"Use cursor/Z/X keys to turn cone"
- Text 0,20,"Pitch: "+pitch#
- Text 0,40,"Yaw: "+yaw#
- Text 0,60,"Roll: "+roll#
-
- Flip
-
- Wend
-
- End
+ + +
+; TurnEntity Example
+; ------------------
+
+Graphics3D 640,480
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+light=CreateLight()
+
+cone=CreateCone( 32 )
+PositionEntity cone,0,0,5
+
+While Not KeyDown( 1 )
+
+; Reset turn values - otherwise, the cone will not stop turning!
+pitch#=0
+yaw#=0
+roll#=0
+
+; Change movement values depending on the key pressed
+If KeyDown( 208 )=True Then pitch#=-1
+If KeyDown( 200 )=True Then pitch#=1
+If KeyDown( 203 )=True Then yaw#=-1
+If KeyDown( 205 )=True Then yaw#=1
+If KeyDown( 45 )=True Then roll#=-1
+If KeyDown( 44 )=True Then roll#=1
+
+; Move sphere using movement values
+TurnEntity cone,pitch#,yaw#,roll#
+
+RenderWorld
+
+Text 0,0,"Use cursor/Z/X keys to turn cone"
+Text 0,20,"Pitch: "+pitch#
+Text 0,40,"Yaw: "+yaw#
+Text 0,60,"Roll: "+roll#
+
+Flip
+
+Wend
+
+End +
-

Index

- - \ 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/UpdateNormals.htm b/_release/help/commands/3d_commands/UpdateNormals.htm index 3435e6a..3c2e36c 100644 --- a/_release/help/commands/3d_commands/UpdateNormals.htm +++ b/_release/help/commands/3d_commands/UpdateNormals.htm @@ -1,38 +1,28 @@ -Command: UpdateNormals - - +Blitz3D Docs + - - -

  UpdateNormals mesh  

- -

-Parameters:
-

- - - - +

UpdateNormals mesh

+

Parameters

+
mesh - mesh handle
+ + +
+mesh - mesh handle +
-

Description:
-
- - - - +

Description

+
Recalculates all normals in a mesh. This is necessary for correct - lighting if you have not set surface normals using 'VertexNormals' commands.
+ + +
+Recalculates all normals in a mesh. This is necessary for correct lighting if you have not set surface normals using 'VertexNormals' commands. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/UpdateWorld.htm b/_release/help/commands/3d_commands/UpdateWorld.htm index 3d53cdb..1f58e9c 100644 --- a/_release/help/commands/3d_commands/UpdateWorld.htm +++ b/_release/help/commands/3d_commands/UpdateWorld.htm @@ -1,44 +1,32 @@ -Command: UpdateWorld - - +Blitz3D Docs + - - -

  UpdateWorld [anim_speed#]  

- -

-Parameters:
-

- - - - +

UpdateWorld [anim_speed#]

+

Parameters

+
anim_speed# (optional) - a master control for animation speed. Defaults to 1.
+ + +
+anim_speed# (optional) - a master control for animation speed. Defaults to 1. +
-

Description:
-
- - - - +

Description

+
Animates all entities in the world, and performs collision checking.

- The optional anim_speed# parameter allows you affect the animation speed of - all entities at once. A value of 1 will animate entities at their usual - animation speed, a value of 2 will animate entities at double their - animation speed, and so on.

-

- For best results use this command once per main loop, just before calling - RenderWorld.

+ + +
+Animates all entities in the world, and performs collision checking.
+
+The optional anim_speed# parameter allows you affect the animation speed of all entities at once. A value of 1 will animate entities at their usual animation speed, a value of 2 will animate entities at double their animation speed, and so on.
+
+For best results use this command once per main loop, just before calling RenderWorld. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/VertexBlue.htm b/_release/help/commands/3d_commands/VertexBlue.htm index f586a37..4b168db 100644 --- a/_release/help/commands/3d_commands/VertexBlue.htm +++ b/_release/help/commands/3d_commands/VertexBlue.htm @@ -1,38 +1,29 @@ -Command: VertexBlue - - +Blitz3D Docs + - - -

  VertexBlue# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexBlue# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the blue component of a vertices color.
+ + +
+Returns the blue component of a vertices color. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexColor.htm b/_release/help/commands/3d_commands/VertexColor.htm index a4717a5..b047eae 100644 --- a/_release/help/commands/3d_commands/VertexColor.htm +++ b/_release/help/commands/3d_commands/VertexColor.htm @@ -1,41 +1,38 @@ -Command: VertexColor - - +Blitz3D Docs + - - -

  VertexColor surface,index,red#,green#,blue#  

- -

-Parameters:
-

- - - - +

VertexColor surface,index,red#,green#,blue#[,alpha#]

+

Parameters

+
surface - surface handle
- index - index of vertex
- red# - red value of vertex
- green# - green value of vertex
- blue# - blue value of vertex
+ + +
+surface - surface handle
+index - index of vertex
+red# - red value of vertex
+green# - green value of vertex
+blue# - blue value of vertex
+alpha# - optional alpha transparency of vertex (0.0 to 1.0 - default: 1.0) +
-

Description:
-
- - - - +

Description

+
Sets the color of an existing vertex.
+ + +
+Sets the color of an existing vertex.
+
+NB. If you want to set the alpha individually for vertices using the alpha# parameter then you need to use EntityFX 32 (to force alpha-blending) on the entity. +
+
+See also: EntityFX. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexCoords.htm b/_release/help/commands/3d_commands/VertexCoords.htm index ad736e9..7af2af6 100644 --- a/_release/help/commands/3d_commands/VertexCoords.htm +++ b/_release/help/commands/3d_commands/VertexCoords.htm @@ -1,45 +1,34 @@ -Command: VertexCoords - - +Blitz3D Docs + - - -

  VertexCoords surface,index,x#,y#,z#  

- -

-Parameters:
-

- - - - +

VertexCoords surface,index,x#,y#,z#

+

Parameters

+
surface - surface handle
- index - index of vertex
- x# - x position of vertex
- y# - y position of vertex
- z# - z position of vertex
+ + +
+surface - surface handle
+index - index of vertex
+x# - x position of vertex
+y# - y position of vertex
+z# - z position of vertex +
-

Description:
-
- - - - +

Description

+
Sets the geometric coordinates of an existing vertex.

This is the - command used to perform what is commonly referred to as 'dynamic mesh - deformation'. It will reposition a vertex so that all the triangle edges - connected to it, will move also. This will give the effect of parts of the - mesh suddenly deforming.

+ + +
+Sets the geometric coordinates of an existing vertex.
+
+This is the command used to perform what is commonly referred to as 'dynamic mesh deformation'. It will reposition a vertex so that all the triangle edges connected to it, will move also. This will give the effect of parts of the mesh suddenly deforming. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexGreen.htm b/_release/help/commands/3d_commands/VertexGreen.htm index ac2ed5e..cad7608 100644 --- a/_release/help/commands/3d_commands/VertexGreen.htm +++ b/_release/help/commands/3d_commands/VertexGreen.htm @@ -1,38 +1,29 @@ -Command: VertexGreen - - +Blitz3D Docs + - - -

  VertexGreen# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexGreen# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the green component of a vertices color.
+ + +
+Returns the green component of a vertices color. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexNX.htm b/_release/help/commands/3d_commands/VertexNX.htm index e4f0588..92bee6a 100644 --- a/_release/help/commands/3d_commands/VertexNX.htm +++ b/_release/help/commands/3d_commands/VertexNX.htm @@ -1,38 +1,29 @@ -Command: VertexNX - - +Blitz3D Docs + - - -

  VertexNX# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexNX# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the x component of a vertices normal.
+ + +
+Returns the x component of a vertices normal. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexNY.htm b/_release/help/commands/3d_commands/VertexNY.htm index bc9c633..0efdaa2 100644 --- a/_release/help/commands/3d_commands/VertexNY.htm +++ b/_release/help/commands/3d_commands/VertexNY.htm @@ -1,38 +1,29 @@ -Command: VertexNY - - +Blitz3D Docs + - - -

  VertexNY# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexNY# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the y component of a vertices normal.
+ + +
+Returns the y component of a vertices normal. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexNZ.htm b/_release/help/commands/3d_commands/VertexNZ.htm index 1231874..3f7d9ec 100644 --- a/_release/help/commands/3d_commands/VertexNZ.htm +++ b/_release/help/commands/3d_commands/VertexNZ.htm @@ -1,38 +1,29 @@ -Command: VertexNZ - - +Blitz3D Docs + - - -

  VertexNZ# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexNZ# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the z component of a vertices normal.
+ + +
+Returns the z component of a vertices normal. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexNormal.htm b/_release/help/commands/3d_commands/VertexNormal.htm index 6d5d07a..30f5a15 100644 --- a/_release/help/commands/3d_commands/VertexNormal.htm +++ b/_release/help/commands/3d_commands/VertexNormal.htm @@ -1,41 +1,32 @@ -Command: VertexNormal - - +Blitz3D Docs + - - -

  VertexNormal surface,index,nx#,ny#,nz#  

- -

-Parameters:
-

- - - - +

VertexNormal surface,index,nx#,ny#,nz#

+

Parameters

+
surface - surface handle
- index - index of vertex
- nx# - normal x of vertex
- ny# - normal y of vertex
- nz# - normal z of vertex
+ + +
+surface - surface handle
+index - index of vertex
+nx# - normal x of vertex
+ny# - normal y of vertex
+nz# - normal z of vertex +
-

Description:
-
- - - - +

Description

+
Sets the normal of an existing vertex.
+ + +
+Sets the normal of an existing vertex. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexRed.htm b/_release/help/commands/3d_commands/VertexRed.htm index 58a5175..aa04cf3 100644 --- a/_release/help/commands/3d_commands/VertexRed.htm +++ b/_release/help/commands/3d_commands/VertexRed.htm @@ -1,38 +1,29 @@ -Command: VertexRed - - +Blitz3D Docs + - - -

  VertexRed# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexRed# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the red component of a vertices color.
+ + +
+Returns the red component of a vertices color. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexTexCoords.htm b/_release/help/commands/3d_commands/VertexTexCoords.htm index 4dacd66..e92ff38 100644 --- a/_release/help/commands/3d_commands/VertexTexCoords.htm +++ b/_release/help/commands/3d_commands/VertexTexCoords.htm @@ -1,42 +1,33 @@ -Command: VertexTexCoords - - +Blitz3D Docs + - - -

  VertexTexCoords surface,index,u#,v#[,w#][,coord_set]  

- -

-Parameters:
-

- - - - +

VertexTexCoords surface,index,u#,v#[,w#][,coord_set]

+

Parameters

+
surface - surface handle
- index - index of surface
- u# - u# coordinate of vertex
- v# - v# coordinate of vertex
- w# (optional) - w# coordinate of vertex
- coord_set (optional) - co_oord set. Should be set to 0 or 1.
+ + +
+surface - surface handle
+index - index of vertex
+u# - u# coordinate of vertex
+v# - v# coordinate of vertex
+w# (optional) - w# coordinate of vertex
+coord_set (optional) - co_oord set. Should be set to 0 or 1. +
-

Description:
-
- - - - +

Description

+
Sets the texture coordinates of an existing vertex.
+ + +
+Sets the texture coordinates of an existing vertex. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexU.htm b/_release/help/commands/3d_commands/VertexU.htm index 7fe17c6..d524d0c 100644 --- a/_release/help/commands/3d_commands/VertexU.htm +++ b/_release/help/commands/3d_commands/VertexU.htm @@ -1,38 +1,32 @@ -Command: VertexU - - +Blitz3D Docs + - - -

  VertexU# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexU# ( surface,index [,coord_set] )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex
+coord_set (optional) - UV mapping coordinate set. Should be set to 0 or 1. +
-

Description:
-
- - - - +

Description

+
Returns the texture u coordinate of a vertex.
+ + +
+Returns the texture u coordinate of a vertex.
+
+See also: VertexV, VertexTexCoords +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexV.htm b/_release/help/commands/3d_commands/VertexV.htm index 55b57dc..1bb3dd2 100644 --- a/_release/help/commands/3d_commands/VertexV.htm +++ b/_release/help/commands/3d_commands/VertexV.htm @@ -1,38 +1,32 @@ -Command: VertexY - - +Blitz3D Docs + - - -

  VertexV# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexV# ( surface,index [,coord_set] )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex
+coord_set (optional) - UV mapping coordinate set. Should be set to 0 or 1. +
-

Description:
-
- - - - +

Description

+
Returns the texture v coordinate of a vertex.
+ + +
+Returns the texture v coordinate of a vertex.
+
+See also: VertexU, VertexTexCoords +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexW.htm b/_release/help/commands/3d_commands/VertexW.htm index 423e522..cbc4b9c 100644 --- a/_release/help/commands/3d_commands/VertexW.htm +++ b/_release/help/commands/3d_commands/VertexW.htm @@ -1,38 +1,29 @@ -Command: VertexW - - +Blitz3D Docs + - - -

  VertexW# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexW# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the texture w coordinate of a vertex.
+ + +
+Returns the texture w coordinate of a vertex. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexX.htm b/_release/help/commands/3d_commands/VertexX.htm index 099ffab..04aabf7 100644 --- a/_release/help/commands/3d_commands/VertexX.htm +++ b/_release/help/commands/3d_commands/VertexX.htm @@ -1,38 +1,29 @@ -Command: VertexX - - +Blitz3D Docs + - - -

  VertexX# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexX# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the x coordinate of a vertex.
+ + +
+Returns the x coordinate of a vertex. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexY.htm b/_release/help/commands/3d_commands/VertexY.htm index 9eb85ee..cb35112 100644 --- a/_release/help/commands/3d_commands/VertexY.htm +++ b/_release/help/commands/3d_commands/VertexY.htm @@ -1,38 +1,29 @@ -Command: VertexY - - +Blitz3D Docs + - - -

  VertexY# ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexY# ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the y coordinate of a vertex.
+ + +
+Returns the y coordinate of a vertex. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/VertexZ.htm b/_release/help/commands/3d_commands/VertexZ.htm index 108e249..21bb0f5 100644 --- a/_release/help/commands/3d_commands/VertexZ.htm +++ b/_release/help/commands/3d_commands/VertexZ.htm @@ -1,38 +1,29 @@ -Command: VertexZ - - +Blitz3D Docs + - - -

  VertexZ ( surface,index )  

- -

-Parameters:
-

- - - - +

VertexZ ( surface,index )

+

Parameters

+
surface - surface handle
- index - index of vertex
+ + +
+surface - surface handle
+index - index of vertex +
-

Description:
-
- - - - +

Description

+
Returns the z coordinate of a vertex.
+ + +
+Returns the z coordinate of a vertex. +
-

Example:
-
- - - - - -
None.
-

Index

- - \ 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/WBuffer.htm b/_release/help/commands/3d_commands/WBuffer.htm index d14d6e2..3167058 100644 --- a/_release/help/commands/3d_commands/WBuffer.htm +++ b/_release/help/commands/3d_commands/WBuffer.htm @@ -1,51 +1,36 @@ -Command: WBuffer - - +Blitz3D Docs + - - -

  Wbuffer enable  

- -

-Parameters:
-

- - - - +

WBuffer enable

+

Parameters

+
enable - true to enable w-buffering rendering, false to disable. Defaults to -true for 16-bit colour mode, false for 24-bit and 32-bit.
+ + +
+enable - True to enable w-buffering rendering, False to disable.
+
+The default WBuffer mode is True for 16-bit colour mode, False for 24-bit and 32-bit. +
-

Description:
-
- - - - +

Description

+
Enables or disables w-buffering.
-
-W-buffering is a technique used to draw 3D object in order of their depth - i.e. -the ones furthest away from the camera first, then the ones closer to the -camera, and so on.
-
-Normally, z-buffering is used to perform such a technique, but a z-buffer can be -slightly inaccurate in 16-bit colour mode, for which the level of precision is -less than in 24-bit or 32-bit colour modes. This means that in some situations, -objects will appear to overlap each other when they shouldn't and so on.
-
-To compensate for this, you can use w-buffering. This is a slightly more -accurate technique than z-buffering, although it may be less compatible on some -set-ups than z-buffering.
+ + +
+Enables or disables w-buffering.
+
+W-buffering is a technique used to draw 3D object in order of their depth - i.e. the ones furthest away from the camera first, then the ones closer to the camera, and so on.
+
+Normally, z-buffering is used to perform such a technique, but a z-buffer can be slightly inaccurate in 16-bit colour mode, for which the level of precision is less than in 24-bit or 32-bit colour modes. This means that in some situations, objects will appear to overlap each other when they shouldn't and so on.
+
+To compensate for this, you can use w-buffering. This is a slightly more accurate technique than z-buffering, although it may be less compatible on some set-ups than z-buffering. +
-

Example:
-
- - - - - -
None.
-

Index

- +
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/Windowed3D.htm b/_release/help/commands/3d_commands/Windowed3D.htm index 14a1bf8..350a3e2 100644 --- a/_release/help/commands/3d_commands/Windowed3D.htm +++ b/_release/help/commands/3d_commands/Windowed3D.htm @@ -1,48 +1,47 @@ -Command: Windowed3D - - +Blitz3D Docs + - - -

  Windowed3D  

- -

-Parameters:
-

- - - - -
n/a
-

Description:
-
- - -
Windowed3D () returns True if a graphics card is capable of rendering 3D graphics modes in a window on the desktop. -

-Certain graphics cards will only allow specific 3D colour depths (eg. Voodoo3 supports only 16-bit 3D modes and Matrox only supports 16 and 32-bit 3D modes but allows 24-bit 2D modes to be set). If the user's desktop is set to a depth unsupported in 3D, Windowed3D will return False. +

Windowed3D()

+

Parameters

+ + + - +
+None.
-

Example:
-
- - - - - +

Description

+
If Windowed3D ()
- Graphics3D 640, 480, 0, 2
- Print "Windowed mode!"
-Else
- Graphics3D 640, 480, 0, 1
- Print "Full screen modes only!"
-EndIf
-
-MouseWait
-End
+ + +
+Windowed3D returns true if the host machine's selected graphics card is capable of rendering 3D graphics in a window using the current desktop colour depth.
+
+This mainly concerns older graphics cards, some of which may not be able to render 3D in a window at all, while others maybe be able to only render in a window if the user's desktop is set to a certain colour depth such as 16. +
- +

Example

+ + + + +
+If Windowed3D ()
+Graphics3D 640, 480, 0, 2
+Print "Windowed mode!"
+Else
+Graphics3D 640, 480, 0, 1
+Print "Full screen modes only!"
+EndIf
+
+MouseWait
+End +
+
+Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_commands/Wireframe.htm b/_release/help/commands/3d_commands/Wireframe.htm index 5343435..13d2f89 100644 --- a/_release/help/commands/3d_commands/Wireframe.htm +++ b/_release/help/commands/3d_commands/Wireframe.htm @@ -1,76 +1,73 @@ -Command: Wireframe - - +Blitz3D Docs + - - -

  Wireframe enable  

- -

-Parameters:
-

- - - - +

Wireframe enable

+

Parameters

+
enable - true to enable wireframe rendering, false to disable. Defaults to -false.
+ + + +
+enable - True to enable wireframe rendering, False to disable.
+
+The default Wireframe mode is False. +
+

Description

+ + + + +
+Enables or disables wireframe rendering.
+
+This will show the outline of each polygon on the screen, with no shaded-in areas.
+
+Wireframe mode should only be used for debugging purposes, as driver support is patchy. For the same reason, no support is offered for the wireframe rendering of individual polygon entities. +
+

Example

+ + + +
+; Wireframe Example
+; -----------------
+
+Graphics3D 640,480,16
+SetBuffer BackBuffer()
+
+camera=CreateCamera()
+
+light=CreateLight()
+RotateEntity light,90,0,0
+
+sphere=CreateSphere( 32 )
+PositionEntity sphere,0,0,2
+
+While Not KeyDown( 1 )
+
+; Toggle wireframe enable value between true and false when spacebar is pressed
+If KeyHit( 57 )=True Then enable=1-enable
+
+; Enable/disable wireframe rendering
+WireFrame enable
+
+RenderWorld
+
+Text 0,0,"Press spacebar to toggle between Wireframe True/False"
+If enable=True Then Text 0,20,"Wireframe True" Else Text 0,20,"Wireframe False"
+
+Flip
+
+Wend
+
+End +
-

Description:
-
- - - - -
Enables or disables wireframe rendering.

This will show the outline of each -polygon on the screen, with no shaded-in areas.

-Wireframe should only be used for debugging purposes, as driver support is -patchy. For the same reason, no support is offered for the wireframe rendering -of individual polygon entities.

-

Example:
-
- - - - - -
; Wireframe Example
- ; -----------------
-
- Graphics3D 640,480,16
- SetBuffer BackBuffer()
-
- camera=CreateCamera()
-
- light=CreateLight()
- RotateEntity light,90,0,0
-
- sphere=CreateSphere( 32 )
- PositionEntity sphere,0,0,2
-
- While Not KeyDown( 1 )
-
- ; Toggle wireframe enable value between true and false when spacebar is - pressed
- If KeyHit( 57 )=True Then enable=1-enable
-
- ; Enable/disable wireframe rendering
- WireFrame enable
-
- RenderWorld
-
- Text 0,0,"Press spacebar to toggle between Wireframe True/False"
- If enable=False Then Text 0,20,"Wireframe False" Else Text 0,20,"Wireframe - True"
-
- Flip
-
- Wend
-
- End
-

Index

- +Index
+
+Click here to view the latest version of this page online diff --git a/_release/help/commands/3d_examples/AddAnimSeq.bb b/_release/help/commands/3d_examples/AddAnimSeq.bb index afb8bab..67fa5ad 100644 --- a/_release/help/commands/3d_examples/AddAnimSeq.bb +++ b/_release/help/commands/3d_examples/AddAnimSeq.bb @@ -1,20 +1,52 @@ -; AddAnimSeq Example -; ---------------- +;Create 3d animation example +;Set up a simple nice looking level Graphics3D 640,480 -SetBuffer BackBuffer() - camera=CreateCamera() -light=CreateLight() +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() -cone=CreateCone() -PositionEntity cone,0,0,5 +;Lets make a bouncing ball that squashes on impact with the floor. +ball=CreateSphere(16) +EntityShininess ball,1 +EntityColor ball,255,0,0 -While Not KeyDown( 1 ) - - RenderWorld - Flip +; 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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/AddTriangle.bb b/_release/help/commands/3d_examples/AddTriangle.bb index 004bbd4..c575217 100644 --- a/_release/help/commands/3d_examples/AddTriangle.bb +++ b/_release/help/commands/3d_examples/AddTriangle.bb @@ -1,25 +1,20 @@ -; AddTriangle Example -; ---------------- - Graphics3D 640,480 SetBuffer BackBuffer() -camera=CreateCamera() : PositionEntity camera,0,0,-5 -light=CreateLight() +mesh = CreateMesh() +surf = CreateSurface(mesh) -mesh=CreateMesh() : DebugLog mesh -surface=CreateSurface(mesh) : DebugLog surface -v0=AddVertex(surface,-1,0,0) : DebugLog v0 -v1=AddVertex(surface,0,2,0) : DebugLog v1 -v2=AddVertex(surface,1,0,0) : DebugLog v2 +v0 = AddVertex (surf, -5,-5,0, 0 ,0) +v1 = AddVertex (surf, 5,-5,0, 1 ,0) +v2 = AddVertex (surf, 0, 5,0, 0.5,1) -t0=AddTriangle(surface,v0,v1,v2) : DebugLog t0 +tri = AddTriangle (surf,v0,v2,v1) -While Not KeyDown( 1 ) - - RenderWorld - Flip +cam = CreateCamera() +MoveEntity cam, 0,0,-7 -Wend +RenderWorld +Flip +WaitKey End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/AddVertex.bb b/_release/help/commands/3d_examples/AddVertex.bb index 2e3fc44..c575217 100644 --- a/_release/help/commands/3d_examples/AddVertex.bb +++ b/_release/help/commands/3d_examples/AddVertex.bb @@ -1,20 +1,20 @@ -; AddVertex Example -; ---------------- - Graphics3D 640,480 SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +mesh = CreateMesh() +surf = CreateSurface(mesh) -cone=CreateCone() -PositionEntity cone,0,0,5 +v0 = AddVertex (surf, -5,-5,0, 0 ,0) +v1 = AddVertex (surf, 5,-5,0, 1 ,0) +v2 = AddVertex (surf, 0, 5,0, 0.5,1) -While Not KeyDown( 1 ) - - RenderWorld - Flip +tri = AddTriangle (surf,v0,v2,v1) -Wend +cam = CreateCamera() +MoveEntity cam, 0,0,-7 -End +RenderWorld +Flip + +WaitKey +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/AmbientLight.bb b/_release/help/commands/3d_examples/AmbientLight.bb index 5641562..0eb6594 100644 --- a/_release/help/commands/3d_examples/AmbientLight.bb +++ b/_release/help/commands/3d_examples/AmbientLight.bb @@ -19,25 +19,25 @@ blue#=127 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 +; 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 ambient light using red, green, blue values - AmbientLight red#,green#,blue# +; Set ambient light color using red, green, blue values +AmbientLight red#,green#,blue# - RenderWorld +RenderWorld - Text 0,0,"Press keys 1-6 to change AmbientLight red#,green#,blue# values - Text 0,20,"Ambient Red: "+red# - Text 0,40,"Ambient Green: "+green# - Text 0,60,"Ambient Blue: "+blue# +Text 0,0,"Press keys 1-6 to change AmbientLight red#,green#,blue# values +Text 0,20,"Ambient Red: "+red# +Text 0,40,"Ambient Green: "+green# +Text 0,60,"Ambient Blue: "+blue# - Flip +Flip Wend diff --git a/_release/help/commands/3d_examples/AnimateMD2.bb b/_release/help/commands/3d_examples/AnimateMD2.bb index 2a1729e..437a418 100644 --- a/_release/help/commands/3d_examples/AnimateMD2.bb +++ b/_release/help/commands/3d_examples/AnimateMD2.bb @@ -25,9 +25,9 @@ PositionEntity gargoyle,0,-45,100 RotateEntity gargoyle,0,180,0 While Not KeyDown( 1 ) - UpdateWorld - RenderWorld - Flip +UpdateWorld +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/AntiAlias.bb b/_release/help/commands/3d_examples/AntiAlias.bb index 515f97c..c585cb2 100644 --- a/_release/help/commands/3d_examples/AntiAlias.bb +++ b/_release/help/commands/3d_examples/AntiAlias.bb @@ -14,18 +14,18 @@ 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 +; 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 +; Enable/disable antialiasing +AntiAlias enable - RenderWorld +RenderWorld - Text 0,0,"Press spacebar to toggle between AntiAlias True/False" - If enable=False Then Text 0,20,"AntiAlias False" Else Text 0,20,"AntiAlias True" +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 +Flip Wend diff --git a/_release/help/commands/3d_examples/BrushColor.bb b/_release/help/commands/3d_examples/BrushColor.bb index 17e513c..94497ed 100644 --- a/_release/help/commands/3d_examples/BrushColor.bb +++ b/_release/help/commands/3d_examples/BrushColor.bb @@ -23,21 +23,21 @@ PaintMesh cube,brush While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/BrushTexture.bb b/_release/help/commands/3d_examples/BrushTexture.bb index 81f962f..fe11e91 100644 --- a/_release/help/commands/3d_examples/BrushTexture.bb +++ b/_release/help/commands/3d_examples/BrushTexture.bb @@ -26,21 +26,21 @@ PaintMesh cube,brush While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/CameraClsColor.bb b/_release/help/commands/3d_examples/CameraClsColor.bb index 80cf94c..8426b71 100644 --- a/_release/help/commands/3d_examples/CameraClsColor.bb +++ b/_release/help/commands/3d_examples/CameraClsColor.bb @@ -1,20 +1,39 @@ ; CameraClsColor Example -; ---------------- +; ---------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +sphere=CreateSphere( 32 ) +PositionEntity sphere,0,0,5 -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 clear color using red, green, blue values +CameraClsColor camera,red#,green#,blue# + +RenderWorld + +Text 0,0,"Press keys 1-6 to change CameraClsColor red#,green#,blue# values +Text 0,20,"Red: "+red# +Text 0,40,"Green: "+green# +Text 0,60,"Blue: "+blue# + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraClsMode.bb b/_release/help/commands/3d_examples/CameraClsMode.bb index 8f6e5d5..3ea8f4a 100644 --- a/_release/help/commands/3d_examples/CameraClsMode.bb +++ b/_release/help/commands/3d_examples/CameraClsMode.bb @@ -1,20 +1,52 @@ ; CameraClsMode Example -; ---------------- +; --------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() +PositionEntity camera,0,1,-10 + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +plane=CreatePlane() +ground_tex=LoadTexture("media/MossyGround.bmp") +EntityTexture plane,ground_tex -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraFogColor.bb b/_release/help/commands/3d_examples/CameraFogColor.bb index cdf17b1..a83d8d1 100644 --- a/_release/help/commands/3d_examples/CameraFogColor.bb +++ b/_release/help/commands/3d_examples/CameraFogColor.bb @@ -1,5 +1,5 @@ -; CameraFogMode Example -; --------------------- +; CameraFogColor Example +; ---------------------- Graphics3D 640,480 SetBuffer BackBuffer() @@ -27,32 +27,32 @@ 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# +; 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 - 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 +; 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 - 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 \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraFogMode.bb b/_release/help/commands/3d_examples/CameraFogMode.bb index 0040e45..315cf52 100644 --- a/_release/help/commands/3d_examples/CameraFogMode.bb +++ b/_release/help/commands/3d_examples/CameraFogMode.bb @@ -17,22 +17,22 @@ 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 +; 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 +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 - 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 \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraFogRange.bb b/_release/help/commands/3d_examples/CameraFogRange.bb index fc8959d..85930a9 100644 --- a/_release/help/commands/3d_examples/CameraFogRange.bb +++ b/_release/help/commands/3d_examples/CameraFogRange.bb @@ -21,27 +21,27 @@ CameraFogMode camera,1 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 +; 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 - 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 \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraPick.bb b/_release/help/commands/3d_examples/CameraPick.bb index 1b400b3..ec10ad5 100644 --- a/_release/help/commands/3d_examples/CameraPick.bb +++ b/_release/help/commands/3d_examples/CameraPick.bb @@ -1,20 +1,54 @@ ; CameraPick Example -; ---------------- +; ------------------ -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraProject.bb b/_release/help/commands/3d_examples/CameraProject.bb index 31af4aa..9f2de33 100644 --- a/_release/help/commands/3d_examples/CameraProject.bb +++ b/_release/help/commands/3d_examples/CameraProject.bb @@ -1,20 +1,53 @@ ; CameraProject Example -; ---------------- +; --------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraRange.bb b/_release/help/commands/3d_examples/CameraRange.bb index 583fba1..e0f3cf4 100644 --- a/_release/help/commands/3d_examples/CameraRange.bb +++ b/_release/help/commands/3d_examples/CameraRange.bb @@ -1,20 +1,44 @@ ; CameraRange Example -; ---------------- +; ------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,1,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +; 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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraViewport.bb b/_release/help/commands/3d_examples/CameraViewport.bb index e804162..6e4fe37 100644 --- a/_release/help/commands/3d_examples/CameraViewport.bb +++ b/_release/help/commands/3d_examples/CameraViewport.bb @@ -7,13 +7,13 @@ SetBuffer BackBuffer() ; Create first camera cam1=CreateCamera() -; Set the first camera's viewport so that it fills the top half of the camera +; 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 +; 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() @@ -26,17 +26,17 @@ 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 +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" +RenderWorld + +Text 0,0,"Use cursor keys to move the first camera about the infinite plane" + +Flip - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CameraZoom.bb b/_release/help/commands/3d_examples/CameraZoom.bb index 5abe5cf..108c23f 100644 --- a/_release/help/commands/3d_examples/CameraZoom.bb +++ b/_release/help/commands/3d_examples/CameraZoom.bb @@ -1,20 +1,56 @@ -; CameraZoom Example -; ---------------- +; CreateZoom Example +; ------------------ Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,1,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CaptureWorld.bb b/_release/help/commands/3d_examples/CaptureWorld.bb index 992263f..1734ac9 100644 --- a/_release/help/commands/3d_examples/CaptureWorld.bb +++ b/_release/help/commands/3d_examples/CaptureWorld.bb @@ -1,20 +1,45 @@ -; CaptureWorld Example -; ---------------- +; CaptureWorld and RenderWorld with tween. -Graphics3D 640,480 -SetBuffer BackBuffer() +; Left/Right arrow keys change tween. Escape quits. -camera=CreateCamera() -light=CreateLight() +Const width = 640, height = 480 +Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205 -cone=CreateCone() -PositionEntity cone,0,0,5 +Graphics3D 640, 480 +AmbientLight 50, 50, 50 -While Not KeyDown( 1 ) - - RenderWorld - Flip +c1 = CreateCone( ) +PositionEntity c1, -5, 0, 0 ; on the left side of the screen +ScaleEntity c1, 1, 3, 1 +EntityColor c1, 255, 0, 0 + +cam = CreateCamera() +PositionEntity cam, 0, 0, -50 +CameraZoom cam, 4 + +lt = CreateLight() : TurnEntity lt, 30, 40, 0 + + +c2 = CopyEntity( c1 ) + +CaptureWorld ; with c1 and c2 identically placed + +MoveEntity c2, 8, 0, 0 ; to the right side of the screen +TurnEntity c2, 0, 0, 90 ; and tilted + +tw# = 100 ; 100 * tween + +; Interpolate between the pre-CaptureWorld ( tween = 0 ) +; arrangement and the current one ( tween = 1 ). + +While Not KeyDown( KEY_ESC ) + +If KeyDown( KEY_LEFT ) Then tw = tw - 1 +If KeyDown( KEY_RIGHT ) Then tw = tw + 1 +RenderWorld tw / 100 +Text 250, 100, "tween = " + ( tw / 100 ) +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/ClearCollisions.bb b/_release/help/commands/3d_examples/ClearCollisions.bb index eca0ce7..39ad67f 100644 --- a/_release/help/commands/3d_examples/ClearCollisions.bb +++ b/_release/help/commands/3d_examples/ClearCollisions.bb @@ -25,36 +25,36 @@ EntityType sphere,type_sphere ; Set up cone collision data EntityType cone,type_cone -; Enable collisions between type_sphere and type_cone, with sphere->polygon method and slide response +; Enable collisions between type_sphere and type_cone, with sphere->polygon method and slide response Collisions type_sphere,type_cone,2,2 While Not KeyDown( 1 ) - x#=0 - y#=0 - z#=0 +x#=0 +y#=0 +z#=0 - If KeyDown( 203 )=True Then x#=-0.1 - If KeyDown( 205 )=True Then x#=0.1 - If KeyDown( 208 )=True Then y#=-0.1 - If KeyDown( 200 )=True Then y#=0.1 - If KeyDown( 44 )=True Then z#=-0.1 - If KeyDown( 30 )=True Then z#=0.1 - - MoveEntity sphere,x#,y#,z# - - ; If spacebar pressed then clear collisions - If KeyHit( 57 )=True Then ClearCollisions - - ; Perform collision checking - UpdateWorld - - RenderWorld - - Text 0,0,"Use cursor/A/Z keys to move sphere" - Text 0,20,"Press spacebar to use ClearCollisions command" - - Flip +If KeyDown( 203 )=True Then x#=-0.1 +If KeyDown( 205 )=True Then x#=0.1 +If KeyDown( 208 )=True Then y#=-0.1 +If KeyDown( 200 )=True Then y#=0.1 +If KeyDown( 44 )=True Then z#=-0.1 +If KeyDown( 30 )=True Then z#=0.1 + +MoveEntity sphere,x#,y#,z# + +; If spacebar pressed then clear collisions +If KeyHit( 57 )=True Then ClearCollisions + +; Perform collision checking +UpdateWorld + +RenderWorld + +Text 0,0,"Use cursor/A/Z keys to move sphere" +Text 0,20,"Press spacebar to use ClearCollisions command" + +Flip Wend diff --git a/_release/help/commands/3d_examples/ClearTextureFilters.bb b/_release/help/commands/3d_examples/ClearTextureFilters.bb index a649eb3..121fc98 100644 --- a/_release/help/commands/3d_examples/ClearTextureFilters.bb +++ b/_release/help/commands/3d_examples/ClearTextureFilters.bb @@ -1,20 +1,52 @@ -; ClearTextureFilters Example -; ---------------- +; ClearTextureFilters and TextureFilter Example. +; ---------------------------------------------- -Graphics3D 640,480 -SetBuffer BackBuffer() +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 -camera=CreateCamera() -light=CreateLight() +Graphics3D 640,480 -cone=CreateCone() -PositionEntity cone,0,0,5 +; Removes any texture filters that might apply. -While Not KeyDown( 1 ) - - RenderWorld - Flip +ClearTextureFilters -Wend +; Add an alpha texture to the list of +; texture filters to apply to files +; that have "_alpha" in their filenames. -End +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 \ No newline at end of file diff --git a/_release/help/commands/3d_examples/Collisions.bb b/_release/help/commands/3d_examples/Collisions.bb index 0a4ee28..8983d1e 100644 --- a/_release/help/commands/3d_examples/Collisions.bb +++ b/_release/help/commands/3d_examples/Collisions.bb @@ -5,8 +5,9 @@ Graphics3D 640,480 SetBuffer BackBuffer() ; Set collision type values -type_character=1 -type_scenery=2 +type_ground=1 +type_character=2 +type_scenery=3 camera=CreateCamera() RotateEntity camera,45,0,0 @@ -15,38 +16,47 @@ PositionEntity camera,0,15,-10 light=CreateLight() RotateEntity light,45,0,0 +; Create cube 'ground' +cube=CreateCube() +ScaleEntity cube,10,10,10 +EntityColor cube,0,127,0 +EntityType cube,type_ground +PositionEntity cube,0,-5,0 + ; Create sphere 'character' sphere=CreateSphere( 32 ) +EntityColor sphere,127,0,0 EntityRadius sphere,1 EntityType sphere,type_character PositionEntity sphere,0,7,0 -; Create cube 'scenery' -cube=CreateCube() -EntityRadius cube,1 -EntityType cube,type_scenery -PositionEntity cube,0,-5,0 -EntityColor cube,127,0,0 -ScaleEntity cube,10,10,10 +; Enable collisions between type_character and type_ground +Collisions type_character,type_ground,2,2 ; Create cylinder 'scenery' cylinder=CreateCylinder( 32 ) ScaleEntity cylinder,2,2,2 -EntityColor cylinder,255,0,0 +EntityColor cylinder,0,0,255 +EntityRadius cylinder,2 +EntityBox cylinder,-2,-2,-2,4,4,4 EntityType cylinder,type_scenery PositionEntity cylinder,-4,7,-4 ; Create cone 'scenery' cone=CreateCone( 32 ) ScaleEntity cone,2,2,2 -EntityColor cone,255,0,0 +EntityColor cone,0,0,255 +EntityRadius cone,2 +EntityBox cone,-2,-2,-2,4,4,4 EntityType cone,type_scenery PositionEntity cone,4,7,-4 ; Create prism 'scenery' prism=CreateCylinder( 3 ) ScaleEntity prism,2,2,2 -EntityColor prism,255,0,0 +EntityColor prism,0,0,255 +EntityRadius prism,2 +EntityBox prism,-2,-2,-2,4,4,4 EntityType prism,type_scenery PositionEntity prism,-4,7,4 RotateEntity prism,0,180,0 @@ -54,7 +64,9 @@ RotateEntity prism,0,180,0 ; Create pyramid 'scenery' pyramid=CreateCone( 4 ) ScaleEntity pyramid,2,2,2 -EntityColor pyramid,255,0,0 +EntityColor pyramid,0,0,255 +EntityRadius pyramid,2 +EntityBox pyramid,-2,-2,-2,4,4,4 EntityType pyramid,type_scenery RotateEntity pyramid,0,45,0 PositionEntity pyramid,4,7,4 @@ -63,55 +75,55 @@ PositionEntity pyramid,4,7,4 method=2 response=2 -method_info$="sphere-to-polygon" +method_info$="ellipsoid-to-polygon" response_info$="slide1" While Not KeyDown( 1 ) - x#=0 - y#=0 - z#=0 +x#=0 +y#=0 +z#=0 - If KeyDown( 203 )=True Then x#=-0.1 - If KeyDown( 205 )=True Then x#=0.1 - If KeyDown( 208 )=True Then z#=-0.1 - If KeyDown( 200 )=True Then z#=0.1 +If KeyDown( 203 )=True Then x#=-0.1 +If KeyDown( 205 )=True Then x#=0.1 +If KeyDown( 208 )=True Then z#=-0.1 +If KeyDown( 200 )=True Then z#=0.1 - MoveEntity sphere,x#,y#,z# - MoveEntity sphere,0,-0.02,0 +MoveEntity sphere,x#,y#,z# +MoveEntity sphere,0,-0.02,0 ; gravity - ; Change collision method - If KeyHit(50)=True - method=method+1 - If method=4 Then method=1 - If method=1 Then method_info$="sphere-to-sphere" - If method=2 Then method_info$="sphere-to-polygon" - If method=3 Then method_info$="sphere-to-box" - EndIf - - ; Change collision response - If KeyHit(19)=True - response=response+1 - If response=4 Then response=1 - If response=1 Then response_info$="stop" - If response=2 Then response_info$="slide1" - If response=3 Then response_info$="slide2" - EndIf - - ; Enable Collions between type_character and type_scenery - Collisions type_character,type_scenery,method,response - - ; Perform collision checking - UpdateWorld - - RenderWorld - - Text 0,0,"Use cursor keys to move sphere" - Text 0,20,"Press M to change collision Method (currently: "+method_info$+")" - Text 0,40,"Press R to change collision Response (currently: "+response_info$+")" - Text 0,60,"Collisions type_character,type_scenery,"+method+","+response - - Flip +; Change collision method +If KeyHit( 50 )=True +method=method+1 +If method=4 Then method=1 +If method=1 Then method_info$="ellipsoid-to-sphere" +If method=2 Then method_info$="ellipsoid-to-polygon" +If method=3 Then method_info$="ellipsoid-to-box" +EndIf + +; Change collision response +If KeyHit( 19 )=True +response=response+1 +If response=4 Then response=1 +If response=1 Then response_info$="stop" +If response=2 Then response_info$="slide1" +If response=3 Then response_info$="slide2" +EndIf + +; Enable collisions between type_character and type_scenery +Collisions type_character,type_scenery,method,response + +; Perform collision checking +UpdateWorld + +RenderWorld + +Text 0,0,"Use cursor keys to move sphere" +Text 0,20,"Press M to change collision Method (currently: "+method_info$+")" +Text 0,40,"Press R to change collision Response (currently: "+response_info$+")" +Text 0,60,"Collisions type_character,type_scenery,"+method+","+response + +Flip Wend diff --git a/_release/help/commands/3d_examples/CopyEntity.bb b/_release/help/commands/3d_examples/CopyEntity.bb index 09a151e..3da8a4b 100644 --- a/_release/help/commands/3d_examples/CopyEntity.bb +++ b/_release/help/commands/3d_examples/CopyEntity.bb @@ -1,20 +1,42 @@ ; CopyEntity Example -; ---------------- +; This example creates an entity and +; allows you to make copies of it. Graphics3D 640,480 -SetBuffer BackBuffer() +AppTitle "CopyEntity Example" -camera=CreateCamera() -light=CreateLight() +Cam = CreateCamera() +Lit = CreateLight() -cone=CreateCone() -PositionEntity cone,0,0,5 +PositionEntity Lit,-5,-5,0 +PositionEntity Cam,0,0,-5 -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CountChildren.bb b/_release/help/commands/3d_examples/CountChildren.bb index 31728ce..ab9111b 100644 --- a/_release/help/commands/3d_examples/CountChildren.bb +++ b/_release/help/commands/3d_examples/CountChildren.bb @@ -1,20 +1,5 @@ -; CountChildren Example -; ---------------- - -Graphics3D 640,480 -SetBuffer BackBuffer() - -camera=CreateCamera() -light=CreateLight() - -cone=CreateCone() -PositionEntity cone,0,0,5 - -While Not KeyDown( 1 ) - - RenderWorld - Flip - -Wend - -End +If CountChildren(entity) > 0 +For childcount = 1 to CountChildren(entity) +child = GetChild(entity,childcount) +Next +Endif \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateBrush.bb b/_release/help/commands/3d_examples/CreateBrush.bb index 8b7dc3c..12ed9f2 100644 --- a/_release/help/commands/3d_examples/CreateBrush.bb +++ b/_release/help/commands/3d_examples/CreateBrush.bb @@ -13,7 +13,7 @@ cube=CreateCube() PositionEntity cube,0,0,5 ; Load texture -tex=LoadTexture("../media/b3dlogo.jpg") +tex=LoadTexture("media/b3dlogo.jpg") ; Create brush brush=CreateBrush() @@ -29,21 +29,21 @@ PaintMesh cube,brush While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/CreateCamera.bb b/_release/help/commands/3d_examples/CreateCamera.bb index 64b37c0..af49278 100644 --- a/_release/help/commands/3d_examples/CreateCamera.bb +++ b/_release/help/commands/3d_examples/CreateCamera.bb @@ -13,8 +13,8 @@ cone=CreateCone() PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateCone.bb b/_release/help/commands/3d_examples/CreateCone.bb index 805a768..3b1b3ff 100644 --- a/_release/help/commands/3d_examples/CreateCone.bb +++ b/_release/help/commands/3d_examples/CreateCone.bb @@ -15,8 +15,8 @@ cone=CreateCone() PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateCube.bb b/_release/help/commands/3d_examples/CreateCube.bb index e11d71f..404b111 100644 --- a/_release/help/commands/3d_examples/CreateCube.bb +++ b/_release/help/commands/3d_examples/CreateCube.bb @@ -15,8 +15,8 @@ cube=CreateCube() PositionEntity cube,0,0,5 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateCylinder.bb b/_release/help/commands/3d_examples/CreateCylinder.bb index 8ecb947..05d2558 100644 --- a/_release/help/commands/3d_examples/CreateCylinder.bb +++ b/_release/help/commands/3d_examples/CreateCylinder.bb @@ -15,8 +15,8 @@ cylinder=CreateCylinder() PositionEntity cylinder,0,0,5 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateLight.bb b/_release/help/commands/3d_examples/CreateLight.bb index 790f925..231cc27 100644 --- a/_release/help/commands/3d_examples/CreateLight.bb +++ b/_release/help/commands/3d_examples/CreateLight.bb @@ -1,20 +1,15 @@ -; CreateLight Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +camera = CreateCamera() +MoveEntity camera,0,0,-3 -cone=CreateCone() -PositionEntity cone,0,0,5 +ball = CreateSphere() -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateListener.bb b/_release/help/commands/3d_examples/CreateListener.bb index 6493851..5a23148 100644 --- a/_release/help/commands/3d_examples/CreateListener.bb +++ b/_release/help/commands/3d_examples/CreateListener.bb @@ -1,20 +1,44 @@ ; CreateListener Example -; ---------------- +; ---------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() +PositionEntity camera,0,1,-10 + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +plane=CreatePlane() +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateMesh.bb b/_release/help/commands/3d_examples/CreateMesh.bb index e2bbcec..596a378 100644 --- a/_release/help/commands/3d_examples/CreateMesh.bb +++ b/_release/help/commands/3d_examples/CreateMesh.bb @@ -1,20 +1,73 @@ ; 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 -cone=CreateCone() -PositionEntity cone,0,0,5 +; Create blank mesh +ramp=CreateMesh() -While Not KeyDown( 1 ) - - RenderWorld - Flip +; 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 -End +; The end! +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateMirror.bb b/_release/help/commands/3d_examples/CreateMirror.bb index d584857..943fbc4 100644 --- a/_release/help/commands/3d_examples/CreateMirror.bb +++ b/_release/help/commands/3d_examples/CreateMirror.bb @@ -25,19 +25,19 @@ mirror=CreateMirror() While Not KeyDown( 1 ) - If KeyDown( 203 )=True Then MoveEntity cone,-0.1,0,0 - If KeyDown( 205 )=True Then MoveEntity cone,0.1,0,0 - If KeyDown( 208 )=True Then MoveEntity cone,0,-0.1,0 - If KeyDown( 200 )=True Then MoveEntity cone,0,0.1,0 - If KeyDown( 44 )=True Then MoveEntity cone,0,0,-0.1 - If KeyDown( 30 )=True Then MoveEntity cone,0,0,0.1 - - RenderWorld - - Text 0,0,"Use cursor/A/Z keys to move cone above infinite mirror" - - Flip - +If KeyDown( 203 )=True Then MoveEntity cone,-0.1,0,0 +If KeyDown( 205 )=True Then MoveEntity cone,0.1,0,0 +If KeyDown( 208 )=True Then MoveEntity cone,0,-0.1,0 +If KeyDown( 200 )=True Then MoveEntity cone,0,0.1,0 +If KeyDown( 44 )=True Then MoveEntity cone,0,0,-0.1 +If KeyDown( 30 )=True Then MoveEntity cone,0,0,0.1 + +RenderWorld + +Text 0,0,"Use cursor/A/Z keys to move cone above infinite mirror" + +Flip + Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreatePivot.bb b/_release/help/commands/3d_examples/CreatePivot.bb index ae4ae0b..eabded4 100644 --- a/_release/help/commands/3d_examples/CreatePivot.bb +++ b/_release/help/commands/3d_examples/CreatePivot.bb @@ -1,20 +1,32 @@ ; CreatePivot Example -; ---------------- +; ------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() +PositionEntity camera,0,0,-10 + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +; Create pivot. This is invisible. +pivot=CreatePivot() -While Not KeyDown( 1 ) - - RenderWorld - Flip +; 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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreatePlane.bb b/_release/help/commands/3d_examples/CreatePlane.bb index c467500..39bb0c4 100644 --- a/_release/help/commands/3d_examples/CreatePlane.bb +++ b/_release/help/commands/3d_examples/CreatePlane.bb @@ -19,17 +19,17 @@ EntityTexture plane,grass_tex 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 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" + +Flip - RenderWorld - - Text 0,0,"Use cursor keys to move about the infinite plane" - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateSphere.bb b/_release/help/commands/3d_examples/CreateSphere.bb index 3a227b1..a5e9112 100644 --- a/_release/help/commands/3d_examples/CreateSphere.bb +++ b/_release/help/commands/3d_examples/CreateSphere.bb @@ -15,8 +15,8 @@ sphere=CreateSphere() PositionEntity sphere,0,0,5 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateSprite.bb b/_release/help/commands/3d_examples/CreateSprite.bb index d0da145..f6db4e5 100644 --- a/_release/help/commands/3d_examples/CreateSprite.bb +++ b/_release/help/commands/3d_examples/CreateSprite.bb @@ -1,20 +1,11 @@ -; CreateSprite Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +cam = CreateCamera() +MoveEntity cam,0,0,-5 -cone=CreateCone() -PositionEntity cone,0,0,5 +sp = CreateSprite() +RotateSprite sp,20 -While Not KeyDown( 1 ) - - RenderWorld - Flip - -Wend - -End +RenderWorld:Flip +WaitKey +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateSurface.bb b/_release/help/commands/3d_examples/CreateSurface.bb index 6852dea..c575217 100644 --- a/_release/help/commands/3d_examples/CreateSurface.bb +++ b/_release/help/commands/3d_examples/CreateSurface.bb @@ -1,40 +1,20 @@ -; CreateSurface Example -; --------------------- - Graphics3D 640,480 SetBuffer BackBuffer() -camera=CreateCamera() -PositionEntity camera,0,0,-5 +mesh = CreateMesh() +surf = CreateSurface(mesh) -light=CreateLight() -RotateEntity light,90,0,0 +v0 = AddVertex (surf, -5,-5,0, 0 ,0) +v1 = AddVertex (surf, 5,-5,0, 1 ,0) +v2 = AddVertex (surf, 0, 5,0, 0.5,1) -mesh=CreateMesh() -surf=CreateSurface( mesh ) +tri = AddTriangle (surf,v0,v2,v1) -Const segs=128,width#=4,depth#=.125 +cam = CreateCamera() +MoveEntity cam, 0,0,-7 -For k=0 To segs - x#=Float(k)*width/segs-width/2 - u#=Float(k)/segs - AddVertex surf,x,1,0,u,0 - AddVertex surf,x,-1,0,u,1 -Next - -For k=0 To segs-1 - AddTriangle surf,k*2,k*2+2,k*2+3 - AddTriangle surf,k*2,k*2+3,k*2+1 -Next - -b=LoadBrush( "../media/b3dlogo.jpg" ) -PaintSurface surf,b - -While Not KeyDown( 1 ) - - RenderWorld - Flip - -Wend +RenderWorld +Flip +WaitKey End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/CreateTexture.bb b/_release/help/commands/3d_examples/CreateTexture.bb index 815de2c..f12bc66 100644 --- a/_release/help/commands/3d_examples/CreateTexture.bb +++ b/_release/help/commands/3d_examples/CreateTexture.bb @@ -13,17 +13,17 @@ cube=CreateCube() PositionEntity cube,0,0,5 ; Create texture of size 256x256 -tex=CreateTexture(256,256) +tex=CreateTexture( 256,256 ) ; Set buffer - texture buffer -SetBuffer TextureBuffer(tex) +SetBuffer TextureBuffer( tex ) ; Clear texture buffer with background white color ClsColor 255,255,255 Cls ; Draw text on texture -font=LoadFont("arial",24) +font=LoadFont( "arial",24 ) SetFont font Color 0,0,0 Text 0,0,"This texture" @@ -40,21 +40,21 @@ SetBuffer BackBuffer() While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/Dither.bb b/_release/help/commands/3d_examples/Dither.bb index 911aaf0..1cf8ef8 100644 --- a/_release/help/commands/3d_examples/Dither.bb +++ b/_release/help/commands/3d_examples/Dither.bb @@ -15,18 +15,18 @@ 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 +; 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 +; Enable/disable hardware dithering +Dither enable - RenderWorld +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" +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 +Flip Wend diff --git a/_release/help/commands/3d_examples/EmitSound.bb b/_release/help/commands/3d_examples/EmitSound.bb index dc1df5c..ade11fd 100644 --- a/_release/help/commands/3d_examples/EmitSound.bb +++ b/_release/help/commands/3d_examples/EmitSound.bb @@ -1,20 +1,44 @@ ; EmitSound Example -; ---------------- +; ----------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() +PositionEntity camera,0,1,-10 + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +plane=CreatePlane() +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityAlpha.bb b/_release/help/commands/3d_examples/EntityAlpha.bb index f14df43..d0bae62 100644 --- a/_release/help/commands/3d_examples/EntityAlpha.bb +++ b/_release/help/commands/3d_examples/EntityAlpha.bb @@ -1,20 +1,45 @@ ; EntityAlpha Example -; ---------------- +; ------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +cube=CreateCube() +Back=CreateCube() + +PositionEntity cube,0,0,5 +PositionEntity back,0,0,15 +ScaleEntity Back,10,2,1 +EntityColor back,255,0,0 +; Set initial entity color values +Alpha#=1 While Not KeyDown( 1 ) - - RenderWorld - Flip + +; Change alpha value depending on key pressed +If alpha#<0.01 Then alpha# = 0 +If alpha#>1 Then alpha# = 1 +If KeyDown( 2 )=True And Alpha#>0 Then Alpha#=Alpha#-0.01 +If KeyDown( 3 )=True And alpha#<1 Then Alpha#=Alpha#+0.01 +; Set entity alpha value +EntityAlpha cube,Alpha# + + +TurnEntity cube,0.1,0.1,0.1 +TurnEntity back,1,0,0 + +RenderWorld + +Text 0,0,"Press keys 1-2 to change EntityAlpha" +Text 0,20,"Entity Alpha: "+Alpha + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityBlend.bb b/_release/help/commands/3d_examples/EntityBlend.bb index e2e13a3..af120df 100644 --- a/_release/help/commands/3d_examples/EntityBlend.bb +++ b/_release/help/commands/3d_examples/EntityBlend.bb @@ -1,20 +1,97 @@ -; EntityBlend Example -; ---------------- - Graphics3D 640,480 + SetBuffer BackBuffer() +SeedRnd MilliSecs() + + +; create camera camera=CreateCamera() -light=CreateLight() +CameraClsColor camera,160,160,160 +PositionEntity camera,0,0,-30 +middle=CreatePivot() +EntityParent camera,middle -cone=CreateCone() -PositionEntity cone,0,0,5 +; 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 -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 -Wend +max_blobs=100 -End +; 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) \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityColor.bb b/_release/help/commands/3d_examples/EntityColor.bb index a1541dd..b63c86b 100644 --- a/_release/help/commands/3d_examples/EntityColor.bb +++ b/_release/help/commands/3d_examples/EntityColor.bb @@ -18,28 +18,28 @@ 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# +; 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 - TurnEntity cube,0.1,0.1,0.1 - - RenderWorld +; Set entity color using red, green, blue values +EntityColor cube,red#,green#,blue# - 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 +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 diff --git a/_release/help/commands/3d_examples/EntityInView.bb b/_release/help/commands/3d_examples/EntityInView.bb index 0e46f0e..5cce020 100644 --- a/_release/help/commands/3d_examples/EntityInView.bb +++ b/_release/help/commands/3d_examples/EntityInView.bb @@ -1,20 +1,53 @@ ; EntityInView Example -; ---------------- +; -------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityPitch.bb b/_release/help/commands/3d_examples/EntityPitch.bb index 522f08a..b9f0279 100644 --- a/_release/help/commands/3d_examples/EntityPitch.bb +++ b/_release/help/commands/3d_examples/EntityPitch.bb @@ -12,27 +12,27 @@ PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 - - TurnEntity cone,pitch#,yaw#,roll# - - RenderWorld +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - Text 0,0,"Use cursor/Z/X keys to turn cone" - - ; Return entity pitch angle of cone - Text 0,20,"Pitch: "+EntityPitch#( cone ) +TurnEntity cone,pitch#,yaw#,roll# - Flip +RenderWorld + +Text 0,0,"Use cursor/Z/X keys to turn cone" + +; Return entity pitch angle of cone +Text 0,20,"Pitch: "+EntityPitch#( cone ) + +Flip Wend diff --git a/_release/help/commands/3d_examples/EntityRadius.bb b/_release/help/commands/3d_examples/EntityRadius.bb index 85f18e1..c5c4932 100644 --- a/_release/help/commands/3d_examples/EntityRadius.bb +++ b/_release/help/commands/3d_examples/EntityRadius.bb @@ -25,41 +25,41 @@ sphere_radius#=1 EntityType sphere,type_sphere EntityType cone,type_cone -; Enable collisions between type_sphere and type_cone, with sphere->polygon method and slide response +; Enable collisions between type_sphere and type_cone, with ellipsoid->polygon method and slide response Collisions type_sphere,type_cone,2,2 While Not KeyDown( 1 ) - x#=0 - y#=0 - z#=0 +x#=0 +y#=0 +z#=0 - If KeyDown( 203 )=True Then x#=-0.1 - If KeyDown( 205 )=True Then x#=0.1 - If KeyDown( 208 )=True Then y#=-0.1 - If KeyDown( 200 )=True Then y#=0.1 - If KeyDown( 44 )=True Then z#=-0.1 - If KeyDown( 30 )=True Then z#=0.1 - - MoveEntity sphere,x#,y#,z# - - ; If square brackets keys pressed then change sphere radius value - If KeyDown( 26 )=True Then sphere_radius#=sphere_radius#-0.1 - If KeyDown( 27 )=True Then sphere_radius#=sphere_radius#+0.1 - - ; Set entity radius of sphere - EntityRadius sphere,sphere_radius# - - ; Perform collision checking - UpdateWorld - - RenderWorld - - Text 0,0,"Use cursor/A/Z keys to move sphere" - Text 0,20,"Press [ or ] to change EntityRadius value" - Text 0,40,"EntityRadius sphere,"+sphere_radius - - Flip +If KeyDown( 203 )=True Then x#=-0.1 +If KeyDown( 205 )=True Then x#=0.1 +If KeyDown( 208 )=True Then y#=-0.1 +If KeyDown( 200 )=True Then y#=0.1 +If KeyDown( 44 )=True Then z#=-0.1 +If KeyDown( 30 )=True Then z#=0.1 + +MoveEntity sphere,x#,y#,z# + +; If square brackets keys pressed then change sphere radius value +If KeyDown( 26 )=True Then sphere_radius#=sphere_radius#-0.1 +If KeyDown( 27 )=True Then sphere_radius#=sphere_radius#+0.1 + +; Set entity radius of sphere +EntityRadius sphere,sphere_radius# + +; Perform collision checking +UpdateWorld + +RenderWorld + +Text 0,0,"Use cursor/A/Z keys to move sphere" +Text 0,20,"Press [ or ] to change EntityRadius radius_x# value" +Text 0,40,"EntityRadius sphere,"+sphere_radius + +Flip Wend diff --git a/_release/help/commands/3d_examples/EntityRoll.bb b/_release/help/commands/3d_examples/EntityRoll.bb index 919bd20..eb207b1 100644 --- a/_release/help/commands/3d_examples/EntityRoll.bb +++ b/_release/help/commands/3d_examples/EntityRoll.bb @@ -12,27 +12,27 @@ PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cone,pitch#,yaw#,roll# - - RenderWorld +TurnEntity cone,pitch#,yaw#,roll# - Text 0,0,"Use cursor/Z/X keys to turn cone" - - ; Return entity roll angle of cone - Text 0,20,"Roll: "+EntityRoll#( cone ) +RenderWorld - Flip +Text 0,0,"Use cursor/Z/X keys to turn cone" + +; Return entity roll angle of cone +Text 0,20,"Roll: "+EntityRoll#( cone ) + +Flip Wend diff --git a/_release/help/commands/3d_examples/EntityShininess.bb b/_release/help/commands/3d_examples/EntityShininess.bb index 17e47b1..345523c 100644 --- a/_release/help/commands/3d_examples/EntityShininess.bb +++ b/_release/help/commands/3d_examples/EntityShininess.bb @@ -1,20 +1,37 @@ ; EntityShininess Example -; ---------------- +; ----------------------- Graphics3D 640,480 SetBuffer BackBuffer() - camera=CreateCamera() +; Set ambient light to a low level, to increase effect of shininess + +AmbientLight 32,32,32 light=CreateLight() +RotateEntity light,45,45,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +sphere=CreateSphere(100) +EntityColor Sphere,255,0,0 +PositionEntity sphere,0,0,4 -While Not KeyDown( 1 ) - - RenderWorld - Flip +; Set initial shine value +shine#=0 + +While Not KeyDown(1) +; Change shine value depending on key pressed + +If KeyDown(2)=True And shine#>0 Then shine#=shine#-0.01 +If KeyDown(3)=True And shine#<1 Then shine#=shine#+0.01 + +; Set entity shininess using shine value +EntityShininess sphere,shine# + +RenderWorld + +Text 0,0,"Press keys 1-2 to change EntityShininess Setting" +Text 0,20,"Entity Shininess: "+shine# + +Flip Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityTexture.bb b/_release/help/commands/3d_examples/EntityTexture.bb index 03cf1a6..6054b3a 100644 --- a/_release/help/commands/3d_examples/EntityTexture.bb +++ b/_release/help/commands/3d_examples/EntityTexture.bb @@ -20,21 +20,21 @@ EntityTexture cube,tex While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/EntityX.bb b/_release/help/commands/3d_examples/EntityX.bb index c5ded4c..d07f36a 100644 --- a/_release/help/commands/3d_examples/EntityX.bb +++ b/_release/help/commands/3d_examples/EntityX.bb @@ -1,39 +1,122 @@ -; EntityX Example -; --------------- +; EntityX / EntityY / EntityZ example. -Graphics3D 640,480 -SetBuffer BackBuffer() +; Escape quits, other keys move or pause the display. -camera=CreateCamera() -light=CreateLight() +Const width = 640, height = 480 +Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205 -cone=CreateCone( 32 ) -PositionEntity cone,0,0,10 +Graphics3D 640, 480 +AmbientLight 50, 50, 50 -While Not KeyDown( 1 ) +Global isMoving = False ; used to pause/resume movement +Global count ; how many updates have been done - x#=0 - y#=0 - z#=0 - If KeyDown(203)=True Then x#=-0.1 - If KeyDown(205)=True Then x#=0.1 - If KeyDown(208)=True Then y#=-0.1 - If KeyDown(200)=True Then y#=0.1 - If KeyDown(44)=True Then z#=-0.1 - If KeyDown(30)=True Then z#=0.1 - - MoveEntity cone,x#,y#,z# - - RenderWorld +; Set up a camera, light and three entities... - Text 0,0,"Use cursor/A/Z keys to move cone" - - ; Return entity x position of cone - Text 0,20,"X Position: "+EntityX#( cone ) +cam = CreateCamera() +PositionEntity cam, 0, 2, -50 +CameraZoom cam, 4 - Flip +lt = CreateLight() : TurnEntity lt, 30, 40, 0 + + +Global oSphere, pCone, cSphere + +oSphere = CreateSphere() +EntityColor oSphere, 250, 50, 0 ; Orange = Origin, parent of cone + +pCone = CreateCone( 8, True, oSphere) ; will be a parent of small sphere +ScaleEntity pCone, .8, 2.0, .8 +PositionEntity pCone, 8, 0, 0 +EntityColor pCone, 255, 255, 0 + +cSphere = CreateSphere( 8, pCone ) ; child of the cone +EntityColor cSphere, 150, 150, 0 +ScaleEntity cSphere, .4/.8, .4/2.0, .4/.8 ; try commenting out this line +PositionEntity cSphere, 0, 2, 0 ; above parent + +; ... and we are ready run. + +While Not KeyDown( KEY_ESC ) + +UpdateEverything +RenderWorld +ShowInfo + +Flip Wend -End \ No newline at end of file +End + + + +Function UpdateEverything( ) + +; Nothing moves relative to its parent, so local coordinates are constant. +; Try uncommenting the PositionEntity command to change this. + + +If GetKey() Then isMoving = Not isMoving + +If isMoving +TurnEntity oSphere, 0, .5, 0 +TurnEntity pCone, .2, 0, 0 + +count = count + 1 +a# = count Mod 360 +; PositionEntity cSphere, 0, 2 + Sin( a ), 0 ; experiment with this + +End If + +End Function + +Function ShowInfo( ) ; global and local coordinates for all entities +Local x$, y$, z$ + +Color 255, 255, 255 +Text 185, 20, "Global" +Text 495, 20, "Local" + +Color 250, 50, 0 +Text 20, 50, "oSphere: " + XYZ( oSphere, True ) +Text 400, 50, XYZ( oSphere, False ) + +Color 255, 255, 0 +Text 20, 75, " pCone: " + XYZ( pCone, True ) +Text 400, 75, XYZ( pCone, False ) + +Color 150, 150, 0 +Text 20, 100, "cSphere: " + XYZ( cSphere, True ) +Text 400, 100, XYZ( cSphere, False ) + +End Function + +; ****************************************************************** + +; These two functions just format the text display. +; Without them there are too many numbers crowding the screen. + +Function Round#( x#, m# ) ; returns x rounded to multiple of m +If m < 0.0 Then m = -m +s# = Sgn( x ) +If x < 0.0 Then x = -x +diff# = x Mod m +If diff < .5 * m +Return ( x - diff ) * s +Else +Return ( m + x - diff ) * s +End If +End Function + + +Function XYZ$( entity, globalFlag ) + +ex# = Round( EntityX( entity, globalFlag ), .001 ) +ey# = Round( EntityY( entity, globalFlag ), .001 ) +ez# = Round( EntityZ( entity, globalFlag ), .001 ) + +Return RSet( ex, 8 ) + RSet( ey, 8 ) + RSet( ez, 8 ) + +End Function \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityY.bb b/_release/help/commands/3d_examples/EntityY.bb index 4c8e666..d07f36a 100644 --- a/_release/help/commands/3d_examples/EntityY.bb +++ b/_release/help/commands/3d_examples/EntityY.bb @@ -1,39 +1,122 @@ -; EntityY Example -; --------------- +; EntityX / EntityY / EntityZ example. -Graphics3D 640,480 -SetBuffer BackBuffer() +; Escape quits, other keys move or pause the display. -camera=CreateCamera() -light=CreateLight() +Const width = 640, height = 480 +Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205 -cone=CreateCone( 32 ) -PositionEntity cone,0,0,10 +Graphics3D 640, 480 +AmbientLight 50, 50, 50 -While Not KeyDown( 1 ) +Global isMoving = False ; used to pause/resume movement +Global count ; how many updates have been done - x#=0 - y#=0 - z#=0 - If KeyDown(203)=True Then x#=-0.1 - If KeyDown(205)=True Then x#=0.1 - If KeyDown(208)=True Then y#=-0.1 - If KeyDown(200)=True Then y#=0.1 - If KeyDown(44)=True Then z#=-0.1 - If KeyDown(30)=True Then z#=0.1 - - MoveEntity cone,x#,y#,z# - - RenderWorld +; Set up a camera, light and three entities... - Text 0,0,"Use cursor/A/Z keys to move cone" - - ; Return entity y position of cone - Text 0,20,"Y Position: "+EntityY#( cone ) +cam = CreateCamera() +PositionEntity cam, 0, 2, -50 +CameraZoom cam, 4 - Flip +lt = CreateLight() : TurnEntity lt, 30, 40, 0 + + +Global oSphere, pCone, cSphere + +oSphere = CreateSphere() +EntityColor oSphere, 250, 50, 0 ; Orange = Origin, parent of cone + +pCone = CreateCone( 8, True, oSphere) ; will be a parent of small sphere +ScaleEntity pCone, .8, 2.0, .8 +PositionEntity pCone, 8, 0, 0 +EntityColor pCone, 255, 255, 0 + +cSphere = CreateSphere( 8, pCone ) ; child of the cone +EntityColor cSphere, 150, 150, 0 +ScaleEntity cSphere, .4/.8, .4/2.0, .4/.8 ; try commenting out this line +PositionEntity cSphere, 0, 2, 0 ; above parent + +; ... and we are ready run. + +While Not KeyDown( KEY_ESC ) + +UpdateEverything +RenderWorld +ShowInfo + +Flip Wend -End \ No newline at end of file +End + + + +Function UpdateEverything( ) + +; Nothing moves relative to its parent, so local coordinates are constant. +; Try uncommenting the PositionEntity command to change this. + + +If GetKey() Then isMoving = Not isMoving + +If isMoving +TurnEntity oSphere, 0, .5, 0 +TurnEntity pCone, .2, 0, 0 + +count = count + 1 +a# = count Mod 360 +; PositionEntity cSphere, 0, 2 + Sin( a ), 0 ; experiment with this + +End If + +End Function + +Function ShowInfo( ) ; global and local coordinates for all entities +Local x$, y$, z$ + +Color 255, 255, 255 +Text 185, 20, "Global" +Text 495, 20, "Local" + +Color 250, 50, 0 +Text 20, 50, "oSphere: " + XYZ( oSphere, True ) +Text 400, 50, XYZ( oSphere, False ) + +Color 255, 255, 0 +Text 20, 75, " pCone: " + XYZ( pCone, True ) +Text 400, 75, XYZ( pCone, False ) + +Color 150, 150, 0 +Text 20, 100, "cSphere: " + XYZ( cSphere, True ) +Text 400, 100, XYZ( cSphere, False ) + +End Function + +; ****************************************************************** + +; These two functions just format the text display. +; Without them there are too many numbers crowding the screen. + +Function Round#( x#, m# ) ; returns x rounded to multiple of m +If m < 0.0 Then m = -m +s# = Sgn( x ) +If x < 0.0 Then x = -x +diff# = x Mod m +If diff < .5 * m +Return ( x - diff ) * s +Else +Return ( m + x - diff ) * s +End If +End Function + + +Function XYZ$( entity, globalFlag ) + +ex# = Round( EntityX( entity, globalFlag ), .001 ) +ey# = Round( EntityY( entity, globalFlag ), .001 ) +ez# = Round( EntityZ( entity, globalFlag ), .001 ) + +Return RSet( ex, 8 ) + RSet( ey, 8 ) + RSet( ez, 8 ) + +End Function \ No newline at end of file diff --git a/_release/help/commands/3d_examples/EntityYaw.bb b/_release/help/commands/3d_examples/EntityYaw.bb index 2b6da01..09f27b1 100644 --- a/_release/help/commands/3d_examples/EntityYaw.bb +++ b/_release/help/commands/3d_examples/EntityYaw.bb @@ -12,27 +12,27 @@ PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cone,pitch#,yaw#,roll# - - RenderWorld +TurnEntity cone,pitch#,yaw#,roll# - Text 0,0,"Use cursor/Z/X keys to turn cone" - - ; Return entity yaw angle of cone - Text 0,20,"Yaw: "+EntityYaw#( cone ) +RenderWorld - Flip +Text 0,0,"Use cursor/Z/X keys to turn cone" + +; Return entity yaw angle of cone +Text 0,20,"Yaw: "+EntityYaw#( cone ) + +Flip Wend diff --git a/_release/help/commands/3d_examples/EntityZ.bb b/_release/help/commands/3d_examples/EntityZ.bb index 7e53d7a..d07f36a 100644 --- a/_release/help/commands/3d_examples/EntityZ.bb +++ b/_release/help/commands/3d_examples/EntityZ.bb @@ -1,39 +1,122 @@ -; EntityZ Example -; --------------- +; EntityX / EntityY / EntityZ example. -Graphics3D 640,480 -SetBuffer BackBuffer() +; Escape quits, other keys move or pause the display. -camera=CreateCamera() -light=CreateLight() +Const width = 640, height = 480 +Const KEY_ESC = 1, KEY_LEFT = 203, KEY_RIGHT = 205 -cone=CreateCone( 32 ) -PositionEntity cone,0,0,10 +Graphics3D 640, 480 +AmbientLight 50, 50, 50 -While Not KeyDown( 1 ) +Global isMoving = False ; used to pause/resume movement +Global count ; how many updates have been done - x#=0 - y#=0 - z#=0 - If KeyDown(203)=True Then x#=-0.1 - If KeyDown(205)=True Then x#=0.1 - If KeyDown(208)=True Then y#=-0.1 - If KeyDown(200)=True Then y#=0.1 - If KeyDown(44)=True Then z#=-0.1 - If KeyDown(30)=True Then z#=0.1 - - MoveEntity cone,x#,y#,z# - - RenderWorld +; Set up a camera, light and three entities... - Text 0,0,"Use cursor/A/Z keys to move cone" - - ; Return entity z position of cone - Text 0,20,"Z Position: "+EntityZ#( cone ) +cam = CreateCamera() +PositionEntity cam, 0, 2, -50 +CameraZoom cam, 4 - Flip +lt = CreateLight() : TurnEntity lt, 30, 40, 0 + + +Global oSphere, pCone, cSphere + +oSphere = CreateSphere() +EntityColor oSphere, 250, 50, 0 ; Orange = Origin, parent of cone + +pCone = CreateCone( 8, True, oSphere) ; will be a parent of small sphere +ScaleEntity pCone, .8, 2.0, .8 +PositionEntity pCone, 8, 0, 0 +EntityColor pCone, 255, 255, 0 + +cSphere = CreateSphere( 8, pCone ) ; child of the cone +EntityColor cSphere, 150, 150, 0 +ScaleEntity cSphere, .4/.8, .4/2.0, .4/.8 ; try commenting out this line +PositionEntity cSphere, 0, 2, 0 ; above parent + +; ... and we are ready run. + +While Not KeyDown( KEY_ESC ) + +UpdateEverything +RenderWorld +ShowInfo + +Flip Wend -End \ No newline at end of file +End + + + +Function UpdateEverything( ) + +; Nothing moves relative to its parent, so local coordinates are constant. +; Try uncommenting the PositionEntity command to change this. + + +If GetKey() Then isMoving = Not isMoving + +If isMoving +TurnEntity oSphere, 0, .5, 0 +TurnEntity pCone, .2, 0, 0 + +count = count + 1 +a# = count Mod 360 +; PositionEntity cSphere, 0, 2 + Sin( a ), 0 ; experiment with this + +End If + +End Function + +Function ShowInfo( ) ; global and local coordinates for all entities +Local x$, y$, z$ + +Color 255, 255, 255 +Text 185, 20, "Global" +Text 495, 20, "Local" + +Color 250, 50, 0 +Text 20, 50, "oSphere: " + XYZ( oSphere, True ) +Text 400, 50, XYZ( oSphere, False ) + +Color 255, 255, 0 +Text 20, 75, " pCone: " + XYZ( pCone, True ) +Text 400, 75, XYZ( pCone, False ) + +Color 150, 150, 0 +Text 20, 100, "cSphere: " + XYZ( cSphere, True ) +Text 400, 100, XYZ( cSphere, False ) + +End Function + +; ****************************************************************** + +; These two functions just format the text display. +; Without them there are too many numbers crowding the screen. + +Function Round#( x#, m# ) ; returns x rounded to multiple of m +If m < 0.0 Then m = -m +s# = Sgn( x ) +If x < 0.0 Then x = -x +diff# = x Mod m +If diff < .5 * m +Return ( x - diff ) * s +Else +Return ( m + x - diff ) * s +End If +End Function + + +Function XYZ$( entity, globalFlag ) + +ex# = Round( EntityX( entity, globalFlag ), .001 ) +ey# = Round( EntityY( entity, globalFlag ), .001 ) +ez# = Round( EntityZ( entity, globalFlag ), .001 ) + +Return RSet( ex, 8 ) + RSet( ey, 8 ) + RSet( ez, 8 ) + +End Function \ No newline at end of file diff --git a/_release/help/commands/3d_examples/FitMesh.bb b/_release/help/commands/3d_examples/FitMesh.bb index b49b1f5..2ae1cf5 100644 --- a/_release/help/commands/3d_examples/FitMesh.bb +++ b/_release/help/commands/3d_examples/FitMesh.bb @@ -1,5 +1,19 @@ ; FitMesh Example -; ---------------- +; --------------- + +; In this example we will demonstrate the use of the FitMesh command. + +; First we will use FitMesh on a semi-transparent blue box. This will represent the dimensions we will +; be using with FitMesh. + +; Then we will use these dimensions on a red cone, so that it appears to fit inside the box when the +; space bar is pressed. + +; The first time the space bar is pressed a uniform FitMesh will be performed, which means the cone +; will be scaled equally along all axis so that at least one axis fits the dimensions specified. + +; The second time the space bar is pressed a non-unifrom FitMesh will be performed, meaning the cone +; will be scaled non-equally along all axes so that all axes fit the dimensions specified. Graphics3D 640,480 SetBuffer BackBuffer() @@ -7,14 +21,57 @@ SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() -cone=CreateCone() -PositionEntity cone,0,0,5 +; Create cube +cube=CreateCube() -While Not KeyDown( 1 ) +; Set cube colour to blue +EntityColor cube,0,0,255 + +; Make cube semi-transparent so we will be able to see cone inside it later +EntityAlpha cube,0.5 + +; Use FitMesh on cube to make it a cuboid +FitMesh cube,-1,-.5,-1,2,1,2 + +; Position cube in front of camera so we can see it +PositionEntity cube,0,-1,5 + +; Create cone +cone=CreateCone() + +; Set cone color to red +EntityColor cone,255,0,0 + +; Position cone in front of camera so we can see it +PositionEntity cone,0,-1,5 + +; Set uniform value to 1 so when space is first pressed, FitMesh will be uniform +uniform=1 + +While Not KeyDown(1) + + ; If space bar pressed.... + If KeyHit(57)=True + ; Set syntax string to show syntax useage + syntax$="FitMesh cone,-1,-.5,-1,2,1,2,"+uniform + + ; Use FitMesh with cone, using same values as used with cube earlier. Cone should now fit in cube. + FitMesh cone,-1,-.5,-1,2,1,2,uniform + + ; Change uniform value from 1 to 0 so when space bar is pressed again FitMesh will be non-uniform + uniform=0 + + EndIf + RenderWorld + + Text 0,0,"Press space to use uniform FitMesh with cone" + Text 0,20,"Press space again to use non-uniform FitMesh with cone" + Text 0,40,syntax$ + Flip Wend - -End + +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/FlipMesh.bb b/_release/help/commands/3d_examples/FlipMesh.bb index 126d606..6eb7031 100644 --- a/_release/help/commands/3d_examples/FlipMesh.bb +++ b/_release/help/commands/3d_examples/FlipMesh.bb @@ -14,7 +14,7 @@ sphere=CreateSphere() ScaleEntity sphere,100,100,100 ; Texture sphere with sky texture -sky_tex=LoadTexture("../media/sky.bmp") +sky_tex=LoadTexture("media/sky.bmp") EntityTexture sphere,sky_tex ; Flip mesh so we can see the inside of it @@ -23,9 +23,9 @@ FlipMesh sphere Color 0,0,0 While Not KeyDown( 1 ) - RenderWorld - Text 0,0,"You are viewing a flipped sphere mesh - makes a great sky!" - Flip +RenderWorld +Text 0,0,"You are viewing a flipped sphere mesh - makes a great sky!" +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/FreeEntity.bb b/_release/help/commands/3d_examples/FreeEntity.bb index e684ba7..c3946a3 100644 --- a/_release/help/commands/3d_examples/FreeEntity.bb +++ b/_release/help/commands/3d_examples/FreeEntity.bb @@ -1,20 +1,40 @@ ; FreeEntity Example -; ---------------- +; This example creates an entity and +; allows you to move it, but shows +; that a handle is no longer valid after +; FreeEntity is used on it. +; Run in Debug Mode Graphics3D 640,480 -SetBuffer BackBuffer() +AppTitle "FreeEntity Example" -camera=CreateCamera() -light=CreateLight() +Cam = CreateCamera() +Lit = CreateLight() -cone=CreateCone() -PositionEntity cone,0,0,5 +PositionEntity Lit,-5,-5,0 +PositionEntity Cam,0,0,-5 -While Not KeyDown( 1 ) - - RenderWorld - Flip +AnEntity = CreateCube() ; This is our Test Entity +RotateMesh AnEntity,45,45,45 +While Not KeyDown(1) ; Until we press ESC + +; Use the Left or Right Arrows to Move the Entity +If KeyDown(203) Then MoveEntity AnEntity,-0.1,0,0 +If KeyDown(205) Then MoveEntity AnEntity,0.1,0,0 + +; Use the Space Key to Free the Entity. It will disappear +; The next time you try to move it, you will get an error +; Notice that the Handle Variable doesn't change after the +; Entity is free. It simply becomes invalid. + +If KeyHit(57) Then FreeEntity AnEntity ; Hit Space to Free! + +RenderWorld ; Draw the Scene + +; What is in the AnEntity handle? +Text 10,10,"Entity Handle: "+AnEntity +Flip ; Flip it into View Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/FreeTexture.bb b/_release/help/commands/3d_examples/FreeTexture.bb index f327cfb..561792d 100644 --- a/_release/help/commands/3d_examples/FreeTexture.bb +++ b/_release/help/commands/3d_examples/FreeTexture.bb @@ -13,33 +13,35 @@ cube=CreateCube() PositionEntity cube,0,0,5 ; Load texture -tex=LoadTexture("../media/b3dlogo.jpg") +tex=LoadTexture( "media/b3dlogo.jpg" ) ; Texture cube with texture EntityTexture cube,tex While Not KeyDown( 1 ) - ; If spacebar pressed then free texture - If KeyHit( 57 )=True Then FreeTexture tex +; If spacebar pressed then free texture +If KeyHit( 57 )=True Then FreeTexture tex - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Text 0,0,"Press spacebar to free texture" - Text 0,20,"As you can see this will not effect already textured entities" - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld + +Text 0,0,"Press spacebar to free texture" +Text 0,20,"As you can see this will not affect already textured entities" + +Flip Wend diff --git a/_release/help/commands/3d_examples/GfxDriver3D.bb b/_release/help/commands/3d_examples/GfxDriver3D.bb index b9e5674..2b27ea7 100644 --- a/_release/help/commands/3d_examples/GfxDriver3D.bb +++ b/_release/help/commands/3d_examples/GfxDriver3D.bb @@ -1,11 +1,8 @@ For a = 1 To CountGfxDrivers () - - If GfxDriver3D (a) - Print GfxDriverName (a) + " is 3D-capable" - Else - Print GfxDriverName (a) + " is NOT 3D-capable" - EndIf - - Delay 100 - +If GfxDriver3D (a) +Print GfxDriverName (a) + " is 3D-capable" +Else +Print GfxDriverName (a) + " is NOT 3D-capable" +EndIf +Delay 100 Next \ No newline at end of file diff --git a/_release/help/commands/3d_examples/GfxMode3D.bb b/_release/help/commands/3d_examples/GfxMode3D.bb index 984ae44..3fd7365 100644 --- a/_release/help/commands/3d_examples/GfxMode3D.bb +++ b/_release/help/commands/3d_examples/GfxMode3D.bb @@ -1,12 +1,8 @@ - For a = 1 To CountGfxModes () - - If GfxMode3D (a) - Print "Mode " + a + " is 3D-capable" - Else - Print "Mode " + a + " is NOT 3D-capable" - EndIf - - Delay 100 - +If GfxMode3D (a) +Print "Mode " + a + " is 3D-capable" +Else +Print "Mode " + a + " is NOT 3D-capable" +EndIf +Delay 100 Next \ No newline at end of file diff --git a/_release/help/commands/3d_examples/Graphics3D.bb b/_release/help/commands/3d_examples/Graphics3D.bb index 1d3437b..836d104 100644 --- a/_release/help/commands/3d_examples/Graphics3D.bb +++ b/_release/help/commands/3d_examples/Graphics3D.bb @@ -1,8 +1,9 @@ ; Graphics3D Example ; ------------------ -; Sets 3D graphics mode +; Set 3D graphics mode Graphics3D 640,480,16,0 + SetBuffer BackBuffer() camera=CreateCamera() @@ -12,8 +13,8 @@ cone=CreateCone( 32 ) PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/HandleSprite.bb b/_release/help/commands/3d_examples/HandleSprite.bb index 38a0267..7659cab 100644 --- a/_release/help/commands/3d_examples/HandleSprite.bb +++ b/_release/help/commands/3d_examples/HandleSprite.bb @@ -1,20 +1,18 @@ -; HandleSprite Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +cam = CreateCamera() +MoveEntity cam,0,0,-5 -cone=CreateCone() -PositionEntity cone,0,0,5 - -While Not KeyDown( 1 ) - - RenderWorld - Flip +sp = CreateSprite() +handlepos# = 0.0 +While Not KeyDown(1) +RenderWorld +Color 100,100,100 +Plot 320,240 +Text 320,250,"Handle",True +Flip +HandleSprite sp,handlepos,handlepos +handlepos = handlepos + 0.01 Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LightColor.bb b/_release/help/commands/3d_examples/LightColor.bb index f90e660..cbf05a1 100644 --- a/_release/help/commands/3d_examples/LightColor.bb +++ b/_release/help/commands/3d_examples/LightColor.bb @@ -1,20 +1,17 @@ -; LightColor Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +camera = CreateCamera() +MoveEntity camera,0,0,-3 -cone=CreateCone() -PositionEntity cone,0,0,5 +ball = CreateSphere() -While Not KeyDown( 1 ) - - RenderWorld - Flip +lite = CreateLight() ; try different lights 1 to 3 +MoveEntity lite,5,0,-15 +PointEntity lite,ball + +While Not KeyDown(1) +RenderWorld:Flip +If KeyHit(57) Then LightColor lite,Rnd(255),Rnd(255),Rnd(255) ; press SPACEBAR to try different light colors Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LightConeAngles.bb b/_release/help/commands/3d_examples/LightConeAngles.bb index c288176..033fd0e 100644 --- a/_release/help/commands/3d_examples/LightConeAngles.bb +++ b/_release/help/commands/3d_examples/LightConeAngles.bb @@ -1,20 +1,18 @@ -; LightConeAngles Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +camera = CreateCamera() +MoveEntity camera,0,0,-40 -cone=CreateCone() -PositionEntity cone,0,0,5 +flat = CreatePlane(10) +TurnEntity flat,-90,0,0 -While Not KeyDown( 1 ) - - RenderWorld - Flip +lite = CreateLight(3) ; try different lights 1 to 3 +MoveEntity lite,0,0,-15 +While Not KeyDown(1) +RenderWorld:Flip +If KeyHit(57) Then ; press SPACEBAR to randomly change the 'cone' of light +LightConeAngles lite, Rand(120),Rand(120) +EndIf Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LightMesh.bb b/_release/help/commands/3d_examples/LightMesh.bb index 350909e..a800b55 100644 --- a/_release/help/commands/3d_examples/LightMesh.bb +++ b/_release/help/commands/3d_examples/LightMesh.bb @@ -1,20 +1,16 @@ -; LightMesh Example -; ---------------- +Graphics3D 640,480 ,16,2 +camera=CreateCamera() -Graphics3D 640,480 -SetBuffer BackBuffer() +ent=CreateSphere() +EntityFX ent,2 ; enable vertex colors +Lightmesh ent,-255,-255,-255 ; reset vertex colors from 255,255,255 (default) to 0,0,0 +LightMesh ent,255,255,0,50,-20,20,-20 ; apply fake lighting -camera=CreateCamera() -light=CreateLight() - -cone=CreateCone() -PositionEntity cone,0,0,5 - -While Not KeyDown( 1 ) - - RenderWorld - Flip +MoveEntity camera,0,2,-10 +PointEntity camera,ent +While Not KeyDown(1) +RenderWorld +Flip Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LightRange.bb b/_release/help/commands/3d_examples/LightRange.bb index feb5e73..fff5928 100644 --- a/_release/help/commands/3d_examples/LightRange.bb +++ b/_release/help/commands/3d_examples/LightRange.bb @@ -1,20 +1,22 @@ -; LightRange Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +camera = CreateCamera() +MoveEntity camera,0,0,-3 -cone=CreateCone() -PositionEntity cone,0,0,5 +ball = CreateSphere() -While Not KeyDown( 1 ) - - RenderWorld - Flip +lite = CreateLight(2) ; try different lights 1 to 3 +MoveEntity lite,5,0,-5 +PointEntity lite,ball +range# = 0.5 +LightRange lite,range + +While Not KeyDown(1) +RenderWorld:Flip +If KeyHit(57) Then ; hit SPACEBAR to increase light range +range = range + 0.5 +LightRange lite,range +EndIf Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/Load3DSound.bb b/_release/help/commands/3d_examples/Load3DSound.bb index be97780..1c17fba 100644 --- a/_release/help/commands/3d_examples/Load3DSound.bb +++ b/_release/help/commands/3d_examples/Load3DSound.bb @@ -1,20 +1,44 @@ ; Load3DSound Example -; ---------------- +; ------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() +PositionEntity camera,0,1,-10 + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +plane=CreatePlane() +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex -While Not KeyDown( 1 ) - - RenderWorld - Flip +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LoadAnimMesh.bb b/_release/help/commands/3d_examples/LoadAnimMesh.bb index fa36478..90c68be 100644 --- a/_release/help/commands/3d_examples/LoadAnimMesh.bb +++ b/_release/help/commands/3d_examples/LoadAnimMesh.bb @@ -1,20 +1,31 @@ ; LoadAnimMesh Example -; ---------------- +; -------------------- + +; In this example we will demonstrate the use of the LoadAnimMesh command. + +; Quite simply, we will load an anim mesh from file, animate it, and then view it. Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() +PositionEntity camera,0,20,-100 ; position camera so that robot will be in view when loaded + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +; Load anim mesh +robot=LoadAnimMesh("media/makbot/mak_robotic.3ds") -While Not KeyDown( 1 ) - - RenderWorld - Flip +; Animate mesh - this will begin an animation sequence which is updated when UpdateWorld is called +Animate robot,2 + +While Not KeyDown(1) + +UpdateWorld ; Update anim - without this our anim mesh will freeze +RenderWorld ; Render everything +Flip ; Show everything Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LoadAnimTexture.bb b/_release/help/commands/3d_examples/LoadAnimTexture.bb index 3156510..88f20bd 100644 --- a/_release/help/commands/3d_examples/LoadAnimTexture.bb +++ b/_release/help/commands/3d_examples/LoadAnimTexture.bb @@ -5,19 +5,39 @@ Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCube() -PositionEntity cone,0,0,5 +cube=CreateCube() +PositionEntity cube,0,0,5 -kaboom=LoadAnimTexture("media/kaboom.bmp",1,60,48,2,2) +; Load anim texture +anim_tex=LoadAnimTexture( "media/boomstrip.bmp",49,64,64,0,39 ) While Not KeyDown( 1 ) - EntityTexture cone,kaboom,1 - - RenderWorld - Flip +; Cycle through anim frame values. 100 represents delay, 39 represents no. of anim frames +frame=MilliSecs()/100 Mod 39 + +; Texture cube with anim texture frame +EntityTexture cube,anim_tex,frame + +pitch#=0 +yaw#=0 +roll#=0 + +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 + +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/LoadMD2.bb b/_release/help/commands/3d_examples/LoadMD2.bb index 0e232c1..d49099c 100644 --- a/_release/help/commands/3d_examples/LoadMD2.bb +++ b/_release/help/commands/3d_examples/LoadMD2.bb @@ -22,8 +22,8 @@ PositionEntity gargoyle,0,-45,100 RotateEntity gargoyle,0,180,0 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LoadMesh.bb b/_release/help/commands/3d_examples/LoadMesh.bb index 741bcaf..1be86bb 100644 --- a/_release/help/commands/3d_examples/LoadMesh.bb +++ b/_release/help/commands/3d_examples/LoadMesh.bb @@ -15,8 +15,8 @@ drum=LoadMesh("media/oil-drum/oildrum.3ds") PositionEntity drum,0,0,MeshDepth(drum)*2 While Not KeyDown( 1 ) - RenderWorld - Flip +RenderWorld +Flip Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LoadSprite.bb b/_release/help/commands/3d_examples/LoadSprite.bb index 27160b5..7791ff9 100644 --- a/_release/help/commands/3d_examples/LoadSprite.bb +++ b/_release/help/commands/3d_examples/LoadSprite.bb @@ -1,20 +1,14 @@ -; LoadSprite Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +campivot = CreatePivot() +cam = CreateCamera(campivot) +MoveEntity cam,0,0,-5 -cone=CreateCone() -PositionEntity cone,0,0,5 - -While Not KeyDown( 1 ) - - RenderWorld - Flip +sp = LoadSprite("grass.bmp") +SpriteViewMode sp,4 +While Not KeyDown(1) +RenderWorld:Flip +TurnEntity campivot,1,1,3 Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LoadTerrain.bb b/_release/help/commands/3d_examples/LoadTerrain.bb index 6220d1b..3b39ac8 100644 --- a/_release/help/commands/3d_examples/LoadTerrain.bb +++ b/_release/help/commands/3d_examples/LoadTerrain.bb @@ -1,5 +1,5 @@ -; LoadTerrain Example -; ------------------- +LoadTerrain Example +------------------- Graphics3D 640,480 SetBuffer BackBuffer() @@ -25,32 +25,25 @@ EntityTexture terrain,grass_tex,0,1 While Not KeyDown( 1 ) - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#)+5 +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#)+5 + +PositionEntity camera,x#,terra_y#,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" + +Flip - PositionEntity camera,x#,terra_y#,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/LoadTexture.bb b/_release/help/commands/3d_examples/LoadTexture.bb index e61cda3..8c3ca27 100644 --- a/_release/help/commands/3d_examples/LoadTexture.bb +++ b/_release/help/commands/3d_examples/LoadTexture.bb @@ -13,28 +13,28 @@ cube=CreateCube() PositionEntity cube,0,0,5 ; Load texture -tex=LoadTexture("../media/b3dlogo.jpg") +tex=LoadTexture( "media/b3dlogo.jpg" ) ; Texture cube with texture EntityTexture cube,tex While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/MD2AnimLength.bb b/_release/help/commands/3d_examples/MD2AnimLength.bb index 8bacec7..6bd20d7 100644 --- a/_release/help/commands/3d_examples/MD2AnimLength.bb +++ b/_release/help/commands/3d_examples/MD2AnimLength.bb @@ -23,13 +23,13 @@ RotateEntity gargoyle,0,180,0 While Not KeyDown( 1 ) - RenderWorld - - ; Output animation length to screen - Text 0,0,"MD2AnimLength: "+MD2AnimLength( gargoyle ) - - Flip - +RenderWorld + +; Output animation length to screen +Text 0,0,"MD2AnimLength: "+MD2AnimLength( gargoyle ) + +Flip + Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/MD2AnimTime.bb b/_release/help/commands/3d_examples/MD2AnimTime.bb index f9fe5ca..0cecb61 100644 --- a/_release/help/commands/3d_examples/MD2AnimTime.bb +++ b/_release/help/commands/3d_examples/MD2AnimTime.bb @@ -25,15 +25,15 @@ PositionEntity gargoyle,0,-45,100 RotateEntity gargoyle,0,180,0 While Not KeyDown( 1 ) - - UpdateWorld - RenderWorld - - ; Output current animation frame to screen - Text 0,0,"MD2AnimTime: "+MD2AnimTime( gargoyle ) - - Flip - + +UpdateWorld +RenderWorld + +; Output current animation frame to screen +Text 0,0,"MD2AnimTime: "+MD2AnimTime( gargoyle ) + +Flip + Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/MD2Animating.bb b/_release/help/commands/3d_examples/MD2Animating.bb index 47bfba1..0db16c7 100644 --- a/_release/help/commands/3d_examples/MD2Animating.bb +++ b/_release/help/commands/3d_examples/MD2Animating.bb @@ -23,19 +23,19 @@ RotateEntity gargoyle,0,180,0 While Not KeyDown( 1 ) - ; Toggle animation stop/start when spacebar pressed - If KeyHit( 57 )=True start=1-start : AnimateMD2 gargoyle,start,0.1,32,46 - - UpdateWorld - RenderWorld - - Text 0,0,"Press spacebar to stop/start md2 animation" - - ; Output current md2 animation status to screen - Text 0,20,"MD2Animating: "+MD2Animating( gargoyle ) - - Flip - +; Toggle animation stop/start when spacebar pressed +If KeyHit( 57 )=True start=1-start : AnimateMD2 gargoyle,start,0.1,32,46 + +UpdateWorld +RenderWorld + +Text 0,0,"Press spacebar to stop/start md2 animation" + +; Output current md2 animation status to screen +Text 0,20,"MD2Animating: "+MD2Animating( gargoyle ) + +Flip + Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/MeshesIntersect.bb b/_release/help/commands/3d_examples/MeshesIntersect.bb index 088e9e9..8b1fddb 100644 --- a/_release/help/commands/3d_examples/MeshesIntersect.bb +++ b/_release/help/commands/3d_examples/MeshesIntersect.bb @@ -17,15 +17,15 @@ PositionEntity crate,20,0,100 While Not KeyDown( 1 ) - TurnEntity drum,1,1,1 - TurnEntity crate,-1,-1,-1 - - RenderWorld - - ; Test to see if drum and crate meshes are intersecting; if so then display message to confirm this - If MeshesIntersect(drum,crate)=True Then Text 0,0,"Meshes are intersecting!" - - Flip +TurnEntity drum,1,1,1 +TurnEntity crate,-1,-1,-1 + +RenderWorld + +; Test to see if drum and crate meshes are intersecting; if so then display message to confirm this +If MeshesIntersect(drum,crate)=True Then Text 0,0,"Meshes are intersecting!" + +Flip Wend diff --git a/_release/help/commands/3d_examples/ModifyTerrain.bb b/_release/help/commands/3d_examples/ModifyTerrain.bb index e77a822..48b622d 100644 --- a/_release/help/commands/3d_examples/ModifyTerrain.bb +++ b/_release/help/commands/3d_examples/ModifyTerrain.bb @@ -1,20 +1,70 @@ ; ModifyTerrain Example -; ---------------- +; --------------------- Graphics3D 640,480 SetBuffer BackBuffer() +terra_size=32 ; initial size of terrain, and no. of grids segments, along each side +x_scale=10 ; x scale of terrain +y_scale=50 ; y scale of terrain +z_scale=10 ; z scale of terrain +marker_x=terra_size/2 ; initial x position of marker +marker_z=terra_size/2 ; initial z position of marker + camera=CreateCamera() +PositionEntity camera,(terra_size*x_scale)/2,50,0 ; position wherever; just try and get good view of terrain! +RotateEntity camera,30,0,0 ; again, try and get good view of terrain + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +; Create terrain +terra=CreateTerrain(terra_size) +ScaleEntity terra,x_scale,y_scale,z_scale -While Not KeyDown( 1 ) - - RenderWorld - Flip +; Texture terrain +grass_tex=LoadTexture("media/mossyground.bmp") +EntityTexture terra,grass_tex + +; Create marker +marker=CreateSphere() +ScaleEntity marker,1,1,1 +EntityColor marker,255,0,0 + +While Not KeyDown(1) + +; Change marker position values depending on cursor key pressed +If KeyHit(205)=True Then marker_x=marker_x+1 +If KeyHit(203)=True Then marker_x=marker_x-1 +If KeyHit(208)=True Then marker_z=marker_z-1 +If KeyHit(200)=True Then marker_z=marker_z+1 + +; Get terrain height at marker position +marker_y#=TerrainHeight(terra,marker_x,marker_z) + +; If A pressed then increase marker_y value and modify terrain +If KeyDown(30)=True +If marker_y#<1 Then marker_y#=marker_y#+0.005 +ModifyTerrain terra,marker_x,marker_z,marker_y# +EndIf + +; If Z pressed then decrease marker_y value and modify terrain +If KeyDown(44)=True +If marker_y#>0 Then marker_y#=marker_y#-0.005 +ModifyTerrain terra,marker_x,marker_z,marker_y# +EndIf + +; Position marker, taking into account x, y and z scales of terrain +PositionEntity marker,marker_x*x_scale,marker_y#*y_scale,marker_z*z_scale + +RenderWorld + +Text 0,0,"Use cursor keys to move marker over the terrain" +Text 0,20,"Press A or Z to alter height of terrain at marker's position" +Text 0,40,"Terrain Height: "+marker_y# + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/MoveEntity.bb b/_release/help/commands/3d_examples/MoveEntity.bb index 265dec1..c199c60 100644 --- a/_release/help/commands/3d_examples/MoveEntity.bb +++ b/_release/help/commands/3d_examples/MoveEntity.bb @@ -14,33 +14,33 @@ MoveEntity cone,0,0,10 While Not KeyDown( 1 ) - ; Reset movement values - otherwise, the cone will not stop! - x#=0 - y#=0 - z#=0 +; Reset movement values - otherwise, the cone will not stop! +x#=0 +y#=0 +z#=0 - ; Change rotation values depending on the key pressed - If KeyDown( 203 )=True Then x#=-0.1 - If KeyDown( 205 )=True Then x#=0.1 - If KeyDown( 208 )=True Then y#=-0.1 - If KeyDown( 200 )=True Then y#=0.1 - If KeyDown( 44 )=True Then z#=-0.1 - If KeyDown( 30 )=True Then z#=0.1 - - ; Move cone using movement values - MoveEntity cone,x#,y#,z# - - ; If spacebar pressed then rotate cone by random amount - If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 ) - - RenderWorld +; Change rotation values depending on the key pressed +If KeyDown( 203 )=True Then x#=-0.1 +If KeyDown( 205 )=True Then x#=0.1 +If KeyDown( 208 )=True Then y#=-0.1 +If KeyDown( 200 )=True Then y#=0.1 +If KeyDown( 44 )=True Then z#=-0.1 +If KeyDown( 30 )=True Then z#=0.1 - Text 0,0,"Use cursor/A/Z keys to move cone, spacebar to rotate cone by random amount" - Text 0,20,"X Movement: "+x# - Text 0,40,"Y Movement: "+y# - Text 0,60,"Z Movement: "+z# +; Move cone using movement values +MoveEntity cone,x#,y#,z# - Flip +; If spacebar pressed then rotate cone by random amount +If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 ) + +RenderWorld + +Text 0,0,"Use cursor/A/Z keys to move cone, spacebar to rotate cone by random amount" +Text 0,20,"X Movement: "+x# +Text 0,40,"Y Movement: "+y# +Text 0,60,"Z Movement: "+z# + +Flip Wend diff --git a/_release/help/commands/3d_examples/PaintMesh.bb b/_release/help/commands/3d_examples/PaintMesh.bb index 16ceef3..8e33d78 100644 --- a/_release/help/commands/3d_examples/PaintMesh.bb +++ b/_release/help/commands/3d_examples/PaintMesh.bb @@ -13,7 +13,7 @@ cube=CreateCube() PositionEntity cube,0,0,5 ; Load texture -tex=LoadTexture("../media/b3dlogo.jpg") +tex=LoadTexture("media/b3dlogo.jpg") ; Create brush brush=CreateBrush() @@ -30,21 +30,21 @@ PaintMesh cube,brush While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/PickedEntity.bb b/_release/help/commands/3d_examples/PickedEntity.bb index 254e7e0..94653af 100644 --- a/_release/help/commands/3d_examples/PickedEntity.bb +++ b/_release/help/commands/3d_examples/PickedEntity.bb @@ -1,20 +1,54 @@ ; PickedEntity Example -; ---------------- +; -------------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedNX.bb b/_release/help/commands/3d_examples/PickedNX.bb index d04afce..f649052 100644 --- a/_release/help/commands/3d_examples/PickedNX.bb +++ b/_release/help/commands/3d_examples/PickedNX.bb @@ -1,20 +1,54 @@ ; PickedNX Example ; ---------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedNY.bb b/_release/help/commands/3d_examples/PickedNY.bb index daab254..a5e74f8 100644 --- a/_release/help/commands/3d_examples/PickedNY.bb +++ b/_release/help/commands/3d_examples/PickedNY.bb @@ -1,20 +1,54 @@ ; PickedNY Example ; ---------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedNZ.bb b/_release/help/commands/3d_examples/PickedNZ.bb index 608a8d1..4c3c746 100644 --- a/_release/help/commands/3d_examples/PickedNZ.bb +++ b/_release/help/commands/3d_examples/PickedNZ.bb @@ -1,20 +1,54 @@ ; PickedNZ Example ; ---------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedSurface.bb b/_release/help/commands/3d_examples/PickedSurface.bb index 0ec0a83..486780c 100644 --- a/_release/help/commands/3d_examples/PickedSurface.bb +++ b/_release/help/commands/3d_examples/PickedSurface.bb @@ -1,20 +1,54 @@ ; PickedSurface Example -; ---------------- +; --------------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedTime.bb b/_release/help/commands/3d_examples/PickedTime.bb index 23c68f7..c9c8ff4 100644 --- a/_release/help/commands/3d_examples/PickedTime.bb +++ b/_release/help/commands/3d_examples/PickedTime.bb @@ -1,20 +1,54 @@ ; PickedTime Example -; ---------------- +; ------------------ -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedTriangle.bb b/_release/help/commands/3d_examples/PickedTriangle.bb index 9697281..8c0d491 100644 --- a/_release/help/commands/3d_examples/PickedTriangle.bb +++ b/_release/help/commands/3d_examples/PickedTriangle.bb @@ -1,20 +1,54 @@ ; PickedTriangle Example -; ---------------- +; ---------------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedX.bb b/_release/help/commands/3d_examples/PickedX.bb index db48874..3673b17 100644 --- a/_release/help/commands/3d_examples/PickedX.bb +++ b/_release/help/commands/3d_examples/PickedX.bb @@ -1,20 +1,54 @@ ; PickedX Example -; ---------------- +; --------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedY.bb b/_release/help/commands/3d_examples/PickedY.bb index adcfd99..2af141e 100644 --- a/_release/help/commands/3d_examples/PickedY.bb +++ b/_release/help/commands/3d_examples/PickedY.bb @@ -1,20 +1,54 @@ ; PickedY Example -; ---------------- +; --------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PickedZ.bb b/_release/help/commands/3d_examples/PickedZ.bb index 48ae119..9e22a7e 100644 --- a/_release/help/commands/3d_examples/PickedZ.bb +++ b/_release/help/commands/3d_examples/PickedZ.bb @@ -1,20 +1,54 @@ ; PickedZ Example -; ---------------- +; --------------- -Graphics3D 640,480 +Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +light=CreateLight() +RotateEntity light,90,0,0 + +plane=CreatePlane() +EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex + +cube=CreateCube() +EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. +cube_tex=LoadTexture("media/b3dlogo.jpg") +EntityTexture cube,cube_tex +PositionEntity cube,0,1,0 While Not KeyDown( 1 ) - - RenderWorld - Flip + +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 use CameraPick with mouse coordinates +; In this example, only three things can be picked: the plane, the cube, or nothing +If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) + +RenderWorld + +Text 0,0,"Use cursor keys to move about" +Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" +Text 0,40,"PickedX: "+PickedX#() +Text 0,60,"PickedY: "+PickedY#() +Text 0,80,"PickedZ: "+PickedZ#() +Text 0,100,"PickedNX: "+PickedNX#() +Text 0,120,"PickedNY: "+PickedNY#() +Text 0,140,"PickedNZ: "+PickedNZ#() +Text 0,160,"PickedTime: "+PickedTime#() +Text 0,180,"PickedEntity: "+PickedEntity() +Text 0,200,"PickedSurface: "+PickedSurface() +Text 0,220,"PickedTriangle: "+PickedTriangle() + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PositionEntity.bb b/_release/help/commands/3d_examples/PositionEntity.bb index 9c8f5c7..732cf33 100644 --- a/_release/help/commands/3d_examples/PositionEntity.bb +++ b/_release/help/commands/3d_examples/PositionEntity.bb @@ -9,32 +9,32 @@ light=CreateLight() cone=CreateCone( 32 ) -; Set position values so that cone is positioned in front of camera, so we can see it to begin with +; Set position values so that cone is positioned in front of camera, so we can see it to begin with x#=0 y#=0 z#=10 While Not KeyDown( 1 ) - ; Change position values depending on key pressed - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +; Change position values depending on key pressed +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.1 - ; Position cone using position values - PositionEntity cone,x#,y#,z# +; Position cone using position values +PositionEntity cone,x#,y#,z# - RenderWorld +RenderWorld - Text 0,0,"Use cursor/A/Z keys to change cone position" - Text 0,20,"X Position: "+x# - Text 0,40,"Y Position: "+y# - Text 0,60,"Z Position: "+z# +Text 0,0,"Use cursor/A/Z keys to change cone position" +Text 0,20,"X Position: "+x# +Text 0,40,"Y Position: "+y# +Text 0,60,"Z Position: "+z# - Flip +Flip Wend diff --git a/_release/help/commands/3d_examples/PositionMesh.bb b/_release/help/commands/3d_examples/PositionMesh.bb index 7928da4..df0482a 100644 --- a/_release/help/commands/3d_examples/PositionMesh.bb +++ b/_release/help/commands/3d_examples/PositionMesh.bb @@ -1,20 +1,41 @@ ; PositionMesh Example -; ---------------- +; -------------------- + +; In this example we will demonstrate the use of the PositionMesh command. + +; Unlike PositionEntity, PositionMesh actually modifies the actual mesh structure. + +; So whereas using PositionEntity 0,0,1 would only move an entity by one unit the first time it was +; used, PositionMesh 0,0,1 will move the mesh by one unit every time it is used. + +; This is because PositionEntity positions an entity based on a fixed mesh structure, whereas +; PositionMesh actually modifies the mesh structure itself. Graphics3D 640,480 SetBuffer BackBuffer() - + camera=CreateCamera() + light=CreateLight() + +; Create cube mesh +cube=CreateCube() -cone=CreateCone() -PositionEntity cone,0,0,5 +; Position cube in front of camera so we can see it +PositionEntity cube,0,0,5 + +While Not KeyDown(1) + + ; If space bar pressed then position mesh 1 unit along the z axis. Also set syntax$ text. + If KeyHit(57)=True Then PositionMesh cube,0,0,1 : syntax$="PositionMesh 0,0,1" -While Not KeyDown( 1 ) - RenderWorld + + Text 0,0,"Press space to position the mesh 1 unit along the z axis" + Text 0,20,syntax$ + Flip Wend - -End + +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/PositionTexture.bb b/_release/help/commands/3d_examples/PositionTexture.bb index 3948a45..9d053a5 100644 --- a/_release/help/commands/3d_examples/PositionTexture.bb +++ b/_release/help/commands/3d_examples/PositionTexture.bb @@ -24,24 +24,24 @@ v_position#=1 While Not KeyDown( 1 ) - ; Change uv position values depending on key pressed - If KeyDown( 208 )=True Then u_position#=u_position#-0.01 - If KeyDown( 200 )=True Then u_position#=u_position#+0.01 - If KeyDown( 203 )=True Then v_position#=v_position#-0.01 - If KeyDown( 205 )=True Then v_position#=v_position#+0.01 +; Change uv position values depending on key pressed +If KeyDown( 208 )=True Then u_position#=u_position#-0.01 +If KeyDown( 200 )=True Then u_position#=u_position#+0.01 +If KeyDown( 203 )=True Then v_position#=v_position#-0.01 +If KeyDown( 205 )=True Then v_position#=v_position#+0.01 - ; Position texture - PositionTexture tex,u_position#,v_position# +; Position texture +PositionTexture tex,u_position#,v_position# - TurnEntity cube,0.1,0.1,0.1 - - RenderWorld - - Text 0,0,"Use cursor keys to change uv position values" - Text 0,20,"u_position#="+u_position# - Text 0,40,"v_position#="+v_position# - - Flip +TurnEntity cube,0.1,0.1,0.1 + +RenderWorld + +Text 0,0,"Use cursor keys to change uv position values" +Text 0,20,"u_position#="+u_position# +Text 0,40,"v_position#="+v_position# + +Flip Wend diff --git a/_release/help/commands/3d_examples/ProjectedX.bb b/_release/help/commands/3d_examples/ProjectedX.bb index a3be65a..c86efb0 100644 --- a/_release/help/commands/3d_examples/ProjectedX.bb +++ b/_release/help/commands/3d_examples/ProjectedX.bb @@ -1,20 +1,53 @@ ; ProjectedX Example -; ---------------- +; ------------------ Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/ProjectedY.bb b/_release/help/commands/3d_examples/ProjectedY.bb index d0e894b..90a3c7f 100644 --- a/_release/help/commands/3d_examples/ProjectedY.bb +++ b/_release/help/commands/3d_examples/ProjectedY.bb @@ -1,20 +1,53 @@ ; ProjectedY Example -; ---------------- +; ------------------ Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/ProjectedZ.bb b/_release/help/commands/3d_examples/ProjectedZ.bb index cc2cf2e..b7e81af 100644 --- a/_release/help/commands/3d_examples/ProjectedZ.bb +++ b/_release/help/commands/3d_examples/ProjectedZ.bb @@ -1,20 +1,53 @@ ; ProjectedZ Example -; ---------------- +; ------------------ Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() +PositionEntity camera,0,2,-10 -cone=CreateCone() -PositionEntity cone,0,0,5 +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 ) - - RenderWorld - Flip + +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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/RotateEntity.bb b/_release/help/commands/3d_examples/RotateEntity.bb index 8e723fc..be4a5b0 100644 --- a/_release/help/commands/3d_examples/RotateEntity.bb +++ b/_release/help/commands/3d_examples/RotateEntity.bb @@ -12,25 +12,25 @@ PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - ; Change rotation values depending on the key pressed - If KeyDown( 208 )=True Then pitch#=pitch#-1 - If KeyDown( 200 )=True Then pitch#=pitch#+1 - If KeyDown( 203 )=True Then yaw#=yaw#-1 - If KeyDown( 205 )=True Then yaw#=yaw#+1 - If KeyDown( 45 )=True Then roll#=roll#-1 - If KeyDown( 44 )=True Then roll#=roll#+1 +; Change rotation values depending on the key pressed +If KeyDown( 208 )=True Then pitch#=pitch#-1 +If KeyDown( 200 )=True Then pitch#=pitch#+1 +If KeyDown( 203 )=True Then yaw#=yaw#-1 +If KeyDown( 205 )=True Then yaw#=yaw#+1 +If KeyDown( 45 )=True Then roll#=roll#-1 +If KeyDown( 44 )=True Then roll#=roll#+1 - ; Rotate cone using rotation values - RotateEntity cone,pitch#,yaw#,roll# - - RenderWorld +; Rotate cone using rotation values +RotateEntity cone,pitch#,yaw#,roll# - Text 0,0,"Use cursor/Z/X keys to change cone rotation" - Text 0,20,"Pitch: "+pitch# - Text 0,40,"Yaw : "+yaw# - Text 0,60,"Roll : "+roll# +RenderWorld - Flip +Text 0,0,"Use cursor/Z/X keys to change cone rotation" +Text 0,20,"Pitch: "+pitch# +Text 0,40,"Yaw : "+yaw# +Text 0,60,"Roll : "+roll# + +Flip Wend diff --git a/_release/help/commands/3d_examples/RotateMesh.bb b/_release/help/commands/3d_examples/RotateMesh.bb index 3412f35..6c7fc90 100644 --- a/_release/help/commands/3d_examples/RotateMesh.bb +++ b/_release/help/commands/3d_examples/RotateMesh.bb @@ -1,20 +1,44 @@ ; RotateMesh Example -; ---------------- +; ------------------ + +; In this example we will demonstrate the use of the RotateMesh command. + +; Unlike RotateEntity, RotateMesh actually modifies the actual mesh structure. + +; So whereas using RotateEntity 0,45,0 would only rotate an entity by 45 degrees the first time it was +; used, RotateMesh 0,45,0 will rotate the mesh every time it is used. + +; This is because RotateEntity rotates an entity based on a fixed mesh structure, whereas RotateMesh +; actually modifies the mesh structure itself. Graphics3D 640,480 SetBuffer BackBuffer() - + camera=CreateCamera() + light=CreateLight() -cone=CreateCone() -PositionEntity cone,0,0,5 +; Rotate light to give better lighting of cube +RotateEntity light,60,30,0 + +; Create cube mesh +cube=CreateCube() + +; Position cube in front of camera so we can see it +PositionEntity cube,0,0,5 + +While Not KeyDown(1) + + ; If space bar pressed then rotate mesh by 45 degrees on the y axis. Also set syntax$ text. + If KeyHit(57)=True Then RotateMesh cube,0,45,0 : syntax$="RotateMesh 0,45,0" -While Not KeyDown( 1 ) - RenderWorld + + Text 0,0,"Press space to rotate mesh by 45 degrees on the y axis" + Text 0,20,syntax$ + Flip Wend - -End + +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/RotateSprite.bb b/_release/help/commands/3d_examples/RotateSprite.bb index 3c858ce..4da4e11 100644 --- a/_release/help/commands/3d_examples/RotateSprite.bb +++ b/_release/help/commands/3d_examples/RotateSprite.bb @@ -1,20 +1,14 @@ -; RotateSprite Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +cam = CreateCamera() +MoveEntity cam,0,0,-5 -cone=CreateCone() -PositionEntity cone,0,0,5 - -While Not KeyDown( 1 ) - - RenderWorld - Flip +sp = CreateSprite() +ang# = 0 +While Not KeyDown(1) +RenderWorld:Flip +RotateSprite sp,ang +ang = ang +3 Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/RotateTexture.bb b/_release/help/commands/3d_examples/RotateTexture.bb index 6321ab5..79dd1c5 100644 --- a/_release/help/commands/3d_examples/RotateTexture.bb +++ b/_release/help/commands/3d_examples/RotateTexture.bb @@ -23,21 +23,21 @@ angle#=1 While Not KeyDown( 1 ) - ; Change texture angle value depending on key pressed - If KeyDown( 205 )=True Then angle#=angle#-1 - If KeyDown( 203 )=True Then angle#=angle#+1 - - ; Rotate texture - RotateTexture tex,angle# +; Change texture angle value depending on key pressed +If KeyDown( 205 )=True Then angle#=angle#-1 +If KeyDown( 203 )=True Then angle#=angle#+1 - TurnEntity cube,0.1,0.1,0.1 - - RenderWorld - - Text 0,0,"Use left and right cursor keys to change texture angle value" - Text 0,20,"angle#="+angle# - - Flip +; Rotate texture +RotateTexture tex,angle# + +TurnEntity cube,0.1,0.1,0.1 + +RenderWorld + +Text 0,0,"Use left and right cursor keys to change texture angle value" +Text 0,20,"angle#="+angle# + +Flip Wend diff --git a/_release/help/commands/3d_examples/ScaleEntity.bb b/_release/help/commands/3d_examples/ScaleEntity.bb index 5f19016..b2df1bc 100644 --- a/_release/help/commands/3d_examples/ScaleEntity.bb +++ b/_release/help/commands/3d_examples/ScaleEntity.bb @@ -17,25 +17,25 @@ z_scale#=1 While Not KeyDown( 1 ) - ; Change scale values depending on the key pressed - If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1 - If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1 - If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1 - If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1 - If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1 - If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1 +; Change scale values depending on the key pressed +If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1 +If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1 +If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1 +If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1 +If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1 +If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1 - ; Scale cone using scale values - ScaleEntity cone,x_scale#,y_scale#,z_scale# - - RenderWorld +; Scale cone using scale values +ScaleEntity cone,x_scale#,y_scale#,z_scale# - Text 0,0,"Use cursor/A/Z keys to scale cone" - Text 0,20,"X Scale: "+x_scale# - Text 0,40,"Y Scale: "+y_scale# - Text 0,60,"Z Scale: "+z_scale# +RenderWorld - Flip +Text 0,0,"Use cursor/A/Z keys to scale cone" +Text 0,20,"X Scale: "+x_scale# +Text 0,40,"Y Scale: "+y_scale# +Text 0,60,"Z Scale: "+z_scale# + +Flip Wend diff --git a/_release/help/commands/3d_examples/ScaleMesh.bb b/_release/help/commands/3d_examples/ScaleMesh.bb index 2a6a38d..767f9d3 100644 --- a/_release/help/commands/3d_examples/ScaleMesh.bb +++ b/_release/help/commands/3d_examples/ScaleMesh.bb @@ -1,20 +1,41 @@ ; ScaleMesh Example -; ---------------- +; ----------------- + +; In this example we will demonstrate the use of the ScaleMesh command. + +; Unlike ScaleEntity, ScaleMesh actually modifies the actual mesh structure. + +; So whereas using ScaleEntity 2,2,2 would only double the size of an entity the first time it was +; used, ScaleMesh 2,2,2 will double the size of the mesh every time it is used. + +; This is because ScaleEntity scales an entity based on a fixed mesh structure, whereas ScaleMesh +; actually modifies the mesh structure itself. Graphics3D 640,480 SetBuffer BackBuffer() - + camera=CreateCamera() + light=CreateLight() + +; Create cube mesh +cube=CreateCube() -cone=CreateCone() -PositionEntity cone,0,0,5 +; Position cube in front of camera so we can see it +PositionEntity cube,0,0,5 + +While Not KeyDown(1) + + ; If space bar pressed then scale cube mesh by 1%. Also set syntax$ text. + If KeyHit(57)=True Then ScaleMesh cube,1.01,1.01,1.01 : syntax$="ScaleMesh 1.01,1.01,1.01" -While Not KeyDown( 1 ) - RenderWorld + + Text 0,0,"Press space to scale mesh by 1%" + Text 0,20,syntax$ + Flip Wend - -End + +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/ScaleSprite.bb b/_release/help/commands/3d_examples/ScaleSprite.bb index 6b4b1b7..8e0e6d6 100644 --- a/_release/help/commands/3d_examples/ScaleSprite.bb +++ b/_release/help/commands/3d_examples/ScaleSprite.bb @@ -1,20 +1,14 @@ -; ScaleSprite Example -; ---------------- - Graphics3D 640,480 -SetBuffer BackBuffer() -camera=CreateCamera() -light=CreateLight() +cam = CreateCamera() +MoveEntity cam,0,0,-5 -cone=CreateCone() -PositionEntity cone,0,0,5 - -While Not KeyDown( 1 ) - - RenderWorld - Flip +sp = CreateSprite() +size# = 1.0 +While Not KeyDown(1) +RenderWorld:Flip +ScaleSprite sp,size,size +size = size + 0.01 Wend - -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/ScaleTexture.bb b/_release/help/commands/3d_examples/ScaleTexture.bb index 6039d3f..06a0494 100644 --- a/_release/help/commands/3d_examples/ScaleTexture.bb +++ b/_release/help/commands/3d_examples/ScaleTexture.bb @@ -24,24 +24,24 @@ v_scale#=1 While Not KeyDown( 1 ) - ; Change uv scale values depending on key pressed - If KeyDown( 208 )=True Then u_scale#=u_scale#-0.01 - If KeyDown( 200 )=True Then u_scale#=u_scale#+0.01 - If KeyDown( 203 )=True Then v_scale#=v_scale#-0.01 - If KeyDown( 205 )=True Then v_scale#=v_scale#+0.01 +; Change uv scale values depending on key pressed +If KeyDown( 208 )=True Then u_scale#=u_scale#-0.01 +If KeyDown( 200 )=True Then u_scale#=u_scale#+0.01 +If KeyDown( 203 )=True Then v_scale#=v_scale#-0.01 +If KeyDown( 205 )=True Then v_scale#=v_scale#+0.01 - ; Scale texture - ScaleTexture tex,u_scale#,v_scale# +; Scale texture +ScaleTexture tex,u_scale#,v_scale# - TurnEntity cube,0.1,0.1,0.1 - - RenderWorld - - Text 0,0,"Use cursor keys to change uv scale values" - Text 0,20,"u_scale#="+u_scale# - Text 0,40,"v_scale#="+v_scale# - - Flip +TurnEntity cube,0.1,0.1,0.1 + +RenderWorld + +Text 0,0,"Use cursor keys to change uv scale values" +Text 0,20,"u_scale#="+u_scale# +Text 0,40,"v_scale#="+v_scale# + +Flip Wend diff --git a/_release/help/commands/3d_examples/SetAnimKey.bb b/_release/help/commands/3d_examples/SetAnimKey.bb index 06dbce4..67fa5ad 100644 --- a/_release/help/commands/3d_examples/SetAnimKey.bb +++ b/_release/help/commands/3d_examples/SetAnimKey.bb @@ -1,20 +1,52 @@ -; SetAnimKey Example -; ---------------- +;Create 3d animation example +;Set up a simple nice looking level Graphics3D 640,480 -SetBuffer BackBuffer() - camera=CreateCamera() -light=CreateLight() +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() -cone=CreateCone() -PositionEntity cone,0,0,5 +;Lets make a bouncing ball that squashes on impact with the floor. +ball=CreateSphere(16) +EntityShininess ball,1 +EntityColor ball,255,0,0 -While Not KeyDown( 1 ) - - RenderWorld - Flip +; 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 +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/SpriteViewMode.bb b/_release/help/commands/3d_examples/SpriteViewMode.bb index 2b9d66e..ed84885 100644 --- a/_release/help/commands/3d_examples/SpriteViewMode.bb +++ b/_release/help/commands/3d_examples/SpriteViewMode.bb @@ -1,20 +1,61 @@ ; SpriteViewMode Example -; ---------------- +; ---------------------- Graphics3D 640,480 SetBuffer BackBuffer() -camera=CreateCamera() +pivot=CreatePivot() +PositionEntity pivot,0,1,0 + +camera=CreateCamera(pivot) +PositionEntity camera,0,0,10 + light=CreateLight() +RotateEntity light,90,0,0 -cone=CreateCone() -PositionEntity cone,0,0,5 +plane=CreatePlane() +ground_tex=LoadTexture("media/Chorme-2.bmp") +EntityTexture plane,ground_tex -While Not KeyDown( 1 ) - - RenderWorld - Flip +sprite=LoadSprite("media/b3dlogo.jpg") +PositionEntity sprite,0,1,0 + +pitch=-15 +yaw=180 +roll=0 +view_mode=1 +view_mode_info$=" (fixed)" + +While Not KeyDown(1) + +If KeyDown(208)=True And pitch<0 Then pitch=pitch+1 +If KeyDown(200)=True And pitch>-89 Then pitch=pitch-1 +If KeyDown(205)=True Then yaw=yaw+1 +If KeyDown(203)=True Then yaw=yaw-1 +If KeyDown(30)=True Then roll=roll+1 +If KeyDown(31)=True Then roll=roll-1 + +; Change sprite view mode depending on key pressed +If KeyHit(2)=True Then view_mode=1 : view_mode_info$=" (fixed)" +If KeyHit(3)=True Then view_mode=2 : view_mode_info$=" (free)" +If KeyHit(4)=True Then view_mode=3 : view_mode_info$=" (upright1)" +If KeyHit(5)=True Then view_mode=4 : view_mode_info$=" (upright2)" + +; Set sprite view mode +SpriteViewMode sprite,view_mode + +RotateEntity pivot,pitch,yaw,0 +PointEntity camera,sprite,roll + +RenderWorld + +Text 0,0,"Use cursor keys to orbit camera around sprite" +Text 0,20,"Press A and S keys to roll camera" +Text 0,40,"Press keys 1-4 to change sprite view mode" +Text 0,60,"SpriteViewMode: "+view_mode+view_mode_info$ + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TFormNormal.bb b/_release/help/commands/3d_examples/TFormNormal.bb index 7508ce7..a947986 100644 --- a/_release/help/commands/3d_examples/TFormNormal.bb +++ b/_release/help/commands/3d_examples/TFormNormal.bb @@ -1,20 +1,20 @@ -; TFormNormal Example -; ---------------- +; TFormNormal example -Graphics3D 640,480 -SetBuffer BackBuffer() +Graphics3D 640, 480 -camera=CreateCamera() -light=CreateLight() +; Just a quick demonstration of the 'normalization' feature. -cone=CreateCone() -PositionEntity cone,0,0,5 +TFormNormal 1,2,2, 0,0 ; transform from world to world -While Not KeyDown( 1 ) - - RenderWorld - Flip +; The transformation from world to world does nothing. +; But afterward the vector (1,2,2) is divided by the length 3. -Wend +message$ = "The normalized vector is ( " +message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )" -End +Text 70, 180, message + +Flip + +WaitKey() +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TFormPoint.bb b/_release/help/commands/3d_examples/TFormPoint.bb index a79c262..d3d26af 100644 --- a/_release/help/commands/3d_examples/TFormPoint.bb +++ b/_release/help/commands/3d_examples/TFormPoint.bb @@ -1,52 +1,22 @@ +; TFormPoint example Graphics3D 640, 480 -cam = CreateCamera () -MoveEntity cam, 5, 0, -5 +s = CreateSphere() ; center at (0,0,0) north pole at (0,1,0) -box = CreateCube () -MoveEntity box, 5, 0, 0 +MoveEntity s, 1,2,3 ; center at (1,2,3) north pole at (1,2+1,3) +ScaleEntity s, 10,10,10 ; center at (1,2,3) north pole at (1,2+10,3) -Repeat +; Now verify that the north pole is at (1,12,3) in the 3d world - If KeyDown (203) TurnEntity cam, 0, 0.5, 0 - If KeyDown (205) TurnEntity cam, 0, -0.5, 0 - If KeyDown (200) MoveEntity cam, 0, 0, 0.1 - If KeyDown (208) MoveEntity cam, 0, 0, -0.1 +TFormPoint 0,1,0, s,0 ; north pole transformed from sphere to world - bx# = EntityX (box) - by# = EntityY (box) - bz# = EntityZ (box) +message$ = "North pole is at ( " +message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )" - cx# = EntityX (cam, 1) - cy# = EntityY (cam, 1) - cz# = EntityZ (cam, 1) - - TFormPoint 0, 0, 0, cam, box - xdist# = TFormedX () - ydist# = TFormedY () - zdist# = TFormedZ () - - UpdateWorld - RenderWorld - - Text 0, 20, "Box's global position" - Text 20, 40, "x: " + bx - Text 20, 60, "y: " + by - Text 20, 80, "z: " + bz - - Text 0, 120, "Camera's global position" - Text 20, 140, "x: " + cx - Text 20, 160, "y: " + cy - Text 20, 180, "z: " + cz +Text 180, 200, message - Text 0, 220, "Camera position relative to box" - Text 20, 240, "x: " + xdist - Text 20, 260, "y: " + ydist - Text 20, 280, "z: " + zdist - - Flip +Flip -Until KeyHit (1) - -End +WaitKey() +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TFormVector.bb b/_release/help/commands/3d_examples/TFormVector.bb index 627da11..7f5b851 100644 --- a/_release/help/commands/3d_examples/TFormVector.bb +++ b/_release/help/commands/3d_examples/TFormVector.bb @@ -1,52 +1,35 @@ +; TFormVector example Graphics3D 640, 480 -cam = CreateCamera () -MoveEntity cam, 5, 0, -5 +p = CreatePivot() -box = CreateCube () -MoveEntity box, 5, 0, 0 +PositionEntity p, 10, 20, 30 ; easy to visualize +TurnEntity p, -5, -15, 25 ; hard to visualize -Repeat +; Question: what would happen if we took one step 'forward'? +; The local vector corresponding to one step forward is (0,0,1) +; in the pivot's local space. We need the global version. - If KeyDown (203) TurnEntity cam, 0, 0.5, 0 - If KeyDown (205) TurnEntity cam, 0, -0.5, 0 - If KeyDown (200) MoveEntity cam, 0, 0, 0.1 - If KeyDown (208) MoveEntity cam, 0, 0, -0.1 +TFormVector 0,0,1, p,0 ; transform from pivot to world - bx# = EntityX (box) - by# = EntityY (box) - bz# = EntityZ (box) +message$ = "'One step forward' vector is ( " +message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )" - cx# = EntityX (cam, 1) - cy# = EntityY (cam, 1) - cz# = EntityZ (cam, 1) - - TFormVector EntityPitch (cam), EntityYaw (cam), EntityRoll (cam), cam, box - xang# = TFormedX () - yang# = TFormedY () - zang# = TFormedZ () - - UpdateWorld - RenderWorld - - Text 0, 20, "Box's global position" - Text 20, 40, "x: " + bx - Text 20, 60, "y: " + by - Text 20, 80, "z: " + bz - - Text 0, 120, "Camera's global position" - Text 20, 140, "x: " + cx - Text 20, 160, "y: " + cy - Text 20, 180, "z: " + cz +Text 70, 180, message - Text 0, 220, "Camera angle relative to box" - Text 20, 240, "x: " + xang - Text 20, 260, "y: " + yang - Text 20, 280, "z: " + zang - - Flip +; Now actually take the step. The new location should be +; (10,20,30) plus the vector we just computed. -Until KeyHit (1) +MoveEntity p, 0,0,1 -End +message$ = "New location of pivot is ( " +message = message + EntityX(p) + ", " +message = message + EntityY(p) + ", " + EntityZ(p) + " )" + +Text 100, 210, message + +Flip + +WaitKey() +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainDetail.bb b/_release/help/commands/3d_examples/TerrainDetail.bb index 055f4ea..5c8dab3 100644 --- a/_release/help/commands/3d_examples/TerrainDetail.bb +++ b/_release/help/commands/3d_examples/TerrainDetail.bb @@ -28,46 +28,46 @@ vertex_morph=True While Not KeyDown( 1 ) - ; Change terrain detail value depending on key pressed - If KeyDown(26) Then terra_detail=terra_detail-10 - If KeyDown(27) Then terra_detail=terra_detail+10 +; Change terrain detail value depending on key pressed +If KeyDown(26) Then terra_detail=terra_detail-10 +If KeyDown(27) Then terra_detail=terra_detail+10 - ; Toggle vertex morphing on/off when spacebar is pressed - If KeyHit(57)=True Then vertex_morph=1-vertex_morph - - ; Set terrain detail, vertex morphing - TerrainDetail terrain,terra_detail,vertex_morph +; Toggle vertex morphing on/off when spacebar is pressed +If KeyHit(57)=True Then vertex_morph=1-vertex_morph - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +; Set terrain detail, vertex morphing +TerrainDetail terrain,terra_detail,vertex_morph - 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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#)+5 +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 + +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#)+5 + +PositionEntity camera,x#,terra_y#,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" +Text 0,20,"Use [ and ] keys to change terrain detail level" +Text 0,40,"Press spacebar to enable/disable vertex morphing" +Text 0,60,"Terrain Detail: "+terra_detail +If vertex_morph=True Then Text 0,80,"Vertex Morphing: True" Else Text 0,80,"Vertex Morphing: False" + +Flip - PositionEntity camera,x#,terra_y#,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" - Text 0,20,"Use [ and ] keys to change terrain detail level" - Text 0,40,"Press spacebar to enable/disable vertex morphing" - Text 0,60,"Terrain Detail: "+terra_detail - If vertex_morph=True Then Text 0,80,"Vertex Morphing: True" Else Text 0,80,"Vertex Morphing: False" - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainHeight.bb b/_release/help/commands/3d_examples/TerrainHeight.bb index 6d94327..50c9866 100644 --- a/_release/help/commands/3d_examples/TerrainHeight.bb +++ b/_release/help/commands/3d_examples/TerrainHeight.bb @@ -1,59 +1,70 @@ -; TerrainY Example -; ---------------- +; TerrainHeight Example +; --------------------- Graphics3D 640,480 SetBuffer BackBuffer() +terra_size=32 ; initial size of terrain, and no. of grids segments, along each side +x_scale=10 ; x scale of terrain +y_scale=50 ; y scale of terrain +z_scale=10 ; z scale of terrain +marker_x=terra_size/2 ; initial x position of marker +marker_z=terra_size/2 ; initial z position of marker + camera=CreateCamera() -PositionEntity camera,1,1,1 +PositionEntity camera,(terra_size*x_scale)/2,50,0 ; position wherever; just try and get good view of terrain! +RotateEntity camera,30,0,0 ; again, try and get good view of terrain light=CreateLight() RotateEntity light,90,0,0 -; Load terrain -terrain=LoadTerrain( "media/height_map.bmp" ) - -; Scale terrain -ScaleEntity terrain,1,50,1 +; Create terrain +terra=CreateTerrain(terra_size) +ScaleEntity terra,x_scale,y_scale,z_scale ; Texture terrain -grass_tex=LoadTexture( "media/mossyground.bmp" ) -EntityTexture terrain,grass_tex,0,1 +grass_tex=LoadTexture("media/mossyground.bmp") +EntityTexture terra,grass_tex -; Set terrain detail, enable vertex morphing -TerrainDetail terrain,4000,True +; Create marker +marker=CreateSphere() +ScaleEntity marker,1,1,1 +EntityColor marker,255,0,0 -While Not KeyDown( 1 ) +While Not KeyDown(1) - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +; Change marker position values depending on cursor key pressed +If KeyHit(205)=True Then marker_x=marker_x+1 +If KeyHit(203)=True Then marker_x=marker_x-1 +If KeyHit(208)=True Then marker_z=marker_z-1 +If KeyHit(200)=True Then marker_z=marker_z+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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#) - - PositionEntity camera,x#,terra_y#+5,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" +; Get terrain height at marker position +marker_y#=TerrainHeight(terra,marker_x,marker_z) + +; If A pressed then increase marker_y value and modify terrain +If KeyDown(30)=True +If marker_y#<1 Then marker_y#=marker_y#+0.005 +ModifyTerrain terra,marker_x,marker_z,marker_y# +EndIf + +; If Z pressed then decrease marker_y value and modify terrain +If KeyDown(44)=True +If marker_y#>0 Then marker_y#=marker_y#-0.005 +ModifyTerrain terra,marker_x,marker_z,marker_y# +EndIf + +; Position marker, taking into account x, y and z scales of terrain +PositionEntity marker,marker_x*x_scale,marker_y#*y_scale,marker_z*z_scale + +RenderWorld + +Text 0,0,"Use cursor keys to move marker over the terrain" +Text 0,20,"Press A or Z to alter height of terrain at marker's position" +Text 0,40,"Terrain Height: "+marker_y# + +Flip - ; Output TerrainY value to screen - Text 0,20,"TerrainY: "+terra_y# - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainShading.bb b/_release/help/commands/3d_examples/TerrainShading.bb index 9c854e0..a2687f3 100644 --- a/_release/help/commands/3d_examples/TerrainShading.bb +++ b/_release/help/commands/3d_examples/TerrainShading.bb @@ -25,40 +25,40 @@ EntityTexture terrain,grass_tex,0,1 While Not KeyDown( 1 ) - ; Toggle terrain shading value between 0 and 1 when spacebar is pressed - If KeyHit(57)=True Then terra_shade=1-terra_shade - - ; Enable/disable terrain shading - TerrainShading terrain,terra_shade +; Toggle terrain shading value between 0 and 1 when spacebar is pressed +If KeyHit(57)=True Then terra_shade=1-terra_shade - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +; Enable/disable terrain shading +TerrainShading terrain,terra_shade - 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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#)+5 +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 + +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#)+5 + +PositionEntity camera,x#,terra_y#,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" +Text 0,20,"Press spacebar to toggle between TerrainShading True/False" +If terra_shade=True Then Text 0,40,"TerrainShading: True" Else Text 0,40,"TerrainShading: False" + +Flip - PositionEntity camera,x#,terra_y#,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" - Text 0,20,"Press spacebar to toggle between TerrainShading True/False" - If terra_shade=True Then Text 0,40,"TerrainShading: True" Else Text 0,40,"TerrainShading: False" - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainSize.bb b/_release/help/commands/3d_examples/TerrainSize.bb index 7cd3cb8..882dc33 100644 --- a/_release/help/commands/3d_examples/TerrainSize.bb +++ b/_release/help/commands/3d_examples/TerrainSize.bb @@ -25,35 +25,35 @@ EntityTexture terrain,grass_tex,0,1 While Not KeyDown( 1 ) - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#)+5 +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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 + +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#)+5 + +PositionEntity camera,x#,terra_y#,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" + +; Output terrain size to screen +Text 0,20,"Terrain Size: "+TerrainSize(terrain) + +Flip - PositionEntity camera,x#,terra_y#,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" - - ; Output terrain size to screen - Text 0,20,"Terrain Size: "+TerrainSize(terrain) - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainX.bb b/_release/help/commands/3d_examples/TerrainX.bb index 7222a0c..8dd5f1e 100644 --- a/_release/help/commands/3d_examples/TerrainX.bb +++ b/_release/help/commands/3d_examples/TerrainX.bb @@ -25,35 +25,35 @@ TerrainDetail terrain,4000,True While Not KeyDown( 1 ) - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#)+5 - - PositionEntity camera,x#,terra_y#,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" +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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 + +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#)+5 + +PositionEntity camera,x#,terra_y#,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" + +; Output TerrainX value to screen +Text 0,20,"TerrainX: "+TerrainX(terrain,x#,terra_y#,z#) + +Flip - ; Output TerrainX value to screen - Text 0,20,"TerrainX: "+TerrainX(terrain,x#,terra_y#,z#) - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainY.bb b/_release/help/commands/3d_examples/TerrainY.bb index 6d94327..394b01a 100644 --- a/_release/help/commands/3d_examples/TerrainY.bb +++ b/_release/help/commands/3d_examples/TerrainY.bb @@ -25,35 +25,35 @@ TerrainDetail terrain,4000,True While Not KeyDown( 1 ) - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#) - - PositionEntity camera,x#,terra_y#+5,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" +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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 + +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#) + +PositionEntity camera,x#,terra_y#+5,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" + +; Output TerrainY value to screen +Text 0,20,"TerrainY: "+terra_y# + +Flip - ; Output TerrainY value to screen - Text 0,20,"TerrainY: "+terra_y# - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TerrainZ.bb b/_release/help/commands/3d_examples/TerrainZ.bb index 158003b..205048e 100644 --- a/_release/help/commands/3d_examples/TerrainZ.bb +++ b/_release/help/commands/3d_examples/TerrainZ.bb @@ -25,35 +25,35 @@ TerrainDetail terrain,4000,True While Not KeyDown( 1 ) - If KeyDown( 203 )=True Then x#=x#-0.1 - If KeyDown( 205 )=True Then x#=x#+0.1 - If KeyDown( 208 )=True Then y#=y#-0.1 - If KeyDown( 200 )=True Then y#=y#+0.1 - If KeyDown( 44 )=True Then z#=z#-0.1 - If KeyDown( 30 )=True Then z#=z#+0.1 +If KeyDown( 203 )=True Then x#=x#-0.1 +If KeyDown( 205 )=True Then x#=x#+0.1 +If KeyDown( 208 )=True Then y#=y#-0.1 +If KeyDown( 200 )=True Then y#=y#+0.1 +If KeyDown( 44 )=True Then z#=z#-0.1 +If KeyDown( 30 )=True Then z#=z#+0.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.1 - If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 - - x#=EntityX(camera) - y#=EntityY(camera) - z#=EntityZ(camera) - - terra_y#=TerrainY(terrain,x#,y#,z#)+5 - - PositionEntity camera,x#,terra_y#,z# - - RenderWorld - - Text 0,0,"Use cursor keys to move about the terrain" +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.1 +If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 + +x#=EntityX(camera) +y#=EntityY(camera) +z#=EntityZ(camera) + +terra_y#=TerrainY(terrain,x#,y#,z#)+5 + +PositionEntity camera,x#,terra_y#,z# + +RenderWorld + +Text 0,0,"Use cursor keys to move about the terrain" + +; Output TerrainZ value to screen +Text 0,20,"TerrainZ: "+TerrainZ(terrain,x#,terra_y#,z#) + +Flip - ; Output TerrainZ value to screen - Text 0,20,"TerrainZ: "+TerrainZ(terrain,x#,terra_y#,z#) - - Flip - Wend End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TextureBlend.bb b/_release/help/commands/3d_examples/TextureBlend.bb index dab8516..ff8c243 100644 --- a/_release/help/commands/3d_examples/TextureBlend.bb +++ b/_release/help/commands/3d_examples/TextureBlend.bb @@ -1,20 +1,68 @@ ; TextureBlend Example -; ---------------- +; -------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() -light=CreateLight() -cone=CreateCone() -PositionEntity cone,0,0,5 +; Choose a background colour which isn't the same colour as anything else, to avoid confusion +CameraClsColor camera,255,0,0 + +light=CreateLight() +RotateEntity light,90,0,0 + +cube=CreateCube() +PositionEntity cube,0,0,5 + +; Load textures +tex0=LoadTexture( "media/b3dlogo.jpg" ) +tex1=LoadTexture( "media/chorme-2.bmp" ) + +; Texture cube with textures +EntityTexture cube,tex0,0,0 +EntityTexture cube,tex1,0,1 + +tex0_blend_info$="no texture" +tex1_blend_info$="no texture" While Not KeyDown( 1 ) - - RenderWorld - Flip + +; Change texture 0 blending mode +If KeyHit( 11 )=True +tex0_blend=tex0_blend+1 +If tex0_blend=4 Then tex0_blend=0 +If tex0_blend=0 Then tex0_blend_info$="no texture" +If tex0_blend=1 Then tex0_blend_info$="no blend" +If tex0_blend=2 Then tex0_blend_info$="multiply" +If tex0_blend=3 Then tex0_blend_info$="add" +EndIf + +; Change texture 1 blending mode +If KeyHit( 2 )=True +tex1_blend=tex1_blend+1 +If tex1_blend=4 Then tex1_blend=0 +If tex1_blend=0 Then tex1_blend_info$="no texture" +If tex1_blend=1 Then tex1_blend_info$="no blend" +If tex1_blend=2 Then tex1_blend_info$="multiply" +If tex1_blend=3 Then tex1_blend_info$="add" +EndIf + +; Set texture blend modes +TextureBlend tex0,tex0_blend +TextureBlend tex1,tex1_blend + +TurnEntity cube,0.1,0.1,0.1 + +RenderWorld + +Text 0,0,"Press 0 to change texture 0's blending mode" +Text 0,20,"Press 1 to change texture 1's blending mode" +Text 0,40,"TextureBlend tex0,"+tex0_blend+" ("+tex0_blend_info$+")" +Text 0,60,"TextureBlend tex1,"+tex1_blend+" ("+tex1_blend_info$+")" + +Flip Wend -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TextureBuffer.bb b/_release/help/commands/3d_examples/TextureBuffer.bb index ab5cebc..e3063d4 100644 --- a/_release/help/commands/3d_examples/TextureBuffer.bb +++ b/_release/help/commands/3d_examples/TextureBuffer.bb @@ -40,21 +40,21 @@ SetBuffer BackBuffer() While Not KeyDown( 1 ) - pitch#=0 - yaw#=0 - roll#=0 +pitch#=0 +yaw#=0 +roll#=0 - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - TurnEntity cube,pitch#,yaw#,roll# - - RenderWorld - Flip +TurnEntity cube,pitch#,yaw#,roll# + +RenderWorld +Flip Wend diff --git a/_release/help/commands/3d_examples/TextureFilter.bb b/_release/help/commands/3d_examples/TextureFilter.bb index fa63dad..121fc98 100644 --- a/_release/help/commands/3d_examples/TextureFilter.bb +++ b/_release/help/commands/3d_examples/TextureFilter.bb @@ -1,20 +1,52 @@ -; TextureFilter Example -; ---------------- +; ClearTextureFilters and TextureFilter Example. +; ---------------------------------------------- -Graphics3D 640,480 -SetBuffer BackBuffer() +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 -camera=CreateCamera() -light=CreateLight() +Graphics3D 640,480 -cone=CreateCone() -PositionEntity cone,0,0,5 +; Removes any texture filters that might apply. -While Not KeyDown( 1 ) - - RenderWorld - Flip +ClearTextureFilters -Wend +; Add an alpha texture to the list of +; texture filters to apply to files +; that have "_alpha" in their filenames. -End +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 \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TextureHeight.bb b/_release/help/commands/3d_examples/TextureHeight.bb index 1e94a72..c0f7453 100644 --- a/_release/help/commands/3d_examples/TextureHeight.bb +++ b/_release/help/commands/3d_examples/TextureHeight.bb @@ -1,20 +1,33 @@ -; TextureHeight Example -; ---------------- +; TextureWidth and TextureHeight Example. +; --------------------------------------- -Graphics3D 640,480 -SetBuffer BackBuffer() +Graphics3D 640,480 -camera=CreateCamera() -light=CreateLight() +; This bit of code creates 4 textures +; of different sizes and shapes. -cone=CreateCone() -PositionEntity cone,0,0,5 +texture1=CreateTexture(256,256,59) +texture2=CreateTexture(256,128,59) +texture3=CreateTexture(128,256,59) +texture4=CreateTexture(200,200,59) -While Not KeyDown( 1 ) - - RenderWorld - Flip +; The following lines print the selected value +; of the texture, and reports the actual texture +; resolution. -Wend -End +Print "Texture 1 was created at 256x256" +Print "On your system the dimensions are "+TextureWidth(texture1)+"x"+TextureHeight(texture1) +Print +Print "Texture 2 was created at 256x128" +Print "On your system the dimensions are "+TextureWidth(texture2)+"x"+TextureHeight(texture2) +Print +Print "Texture 3 was created at 128x256" +Print "On your system the dimensions are "+TextureWidth(texture3)+"x"+TextureHeight(texture3) +Print +Print "Texture 4 was created at 200x200" +Print "On your system the dimensions are "+TextureWidth(texture4)+"x"+TextureHeight(texture4) + +WaitKey + +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TextureWidth.bb b/_release/help/commands/3d_examples/TextureWidth.bb index 9d335c2..c0f7453 100644 --- a/_release/help/commands/3d_examples/TextureWidth.bb +++ b/_release/help/commands/3d_examples/TextureWidth.bb @@ -1,20 +1,33 @@ -; TextureWidth Example -; ---------------- +; TextureWidth and TextureHeight Example. +; --------------------------------------- -Graphics3D 640,480 -SetBuffer BackBuffer() +Graphics3D 640,480 -camera=CreateCamera() -light=CreateLight() +; This bit of code creates 4 textures +; of different sizes and shapes. -cone=CreateCone() -PositionEntity cone,0,0,5 +texture1=CreateTexture(256,256,59) +texture2=CreateTexture(256,128,59) +texture3=CreateTexture(128,256,59) +texture4=CreateTexture(200,200,59) -While Not KeyDown( 1 ) - - RenderWorld - Flip +; The following lines print the selected value +; of the texture, and reports the actual texture +; resolution. -Wend -End +Print "Texture 1 was created at 256x256" +Print "On your system the dimensions are "+TextureWidth(texture1)+"x"+TextureHeight(texture1) +Print +Print "Texture 2 was created at 256x128" +Print "On your system the dimensions are "+TextureWidth(texture2)+"x"+TextureHeight(texture2) +Print +Print "Texture 3 was created at 128x256" +Print "On your system the dimensions are "+TextureWidth(texture3)+"x"+TextureHeight(texture3) +Print +Print "Texture 4 was created at 200x200" +Print "On your system the dimensions are "+TextureWidth(texture4)+"x"+TextureHeight(texture4) + +WaitKey + +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/TranslateEntity.bb b/_release/help/commands/3d_examples/TranslateEntity.bb index b45a941..8c4383c 100644 --- a/_release/help/commands/3d_examples/TranslateEntity.bb +++ b/_release/help/commands/3d_examples/TranslateEntity.bb @@ -9,38 +9,41 @@ light=CreateLight() cone=CreateCone( 32 ) +; Rotate cone by random amount to demonstrate that TranslateEntity is independent of entity orientation +RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 ) + ; Translate cone in front of camera, so we can see it to begin with TranslateEntity cone,0,0,10 While Not KeyDown( 1 ) - ; Reset translation values - otherwise, the cone will not stop! - x#=0 - y#=0 - z#=0 - - ; Change translation values depending on the key pressed - If KeyDown( 203 )=True Then x#=-0.1 - If KeyDown( 205 )=True Then x#=0.1 - If KeyDown( 208 )=True Then y#=-0.1 - If KeyDown( 200 )=True Then y#=0.1 - If KeyDown( 44 )=True Then z#=-0.1 - If KeyDown( 30 )=True Then z#=0.1 - - ; Translate sphere using translation values - TranslateEntity cone,x#,y#,z# - - ; If spacebar pressed then rotate cone by random amount - If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 ) +; Reset translation values - otherwise, the cone will not stop! +x#=0 +y#=0 +z#=0 - RenderWorld +; Change translation values depending on the key pressed +If KeyDown( 203 )=True Then x#=-0.1 +If KeyDown( 205 )=True Then x#=0.1 +If KeyDown( 208 )=True Then y#=-0.1 +If KeyDown( 200 )=True Then y#=0.1 +If KeyDown( 44 )=True Then z#=-0.1 +If KeyDown( 30 )=True Then z#=0.1 - Text 0,0,"Use cursor/A/Z keys to translate cone, spacebar to rotate cone by random amount" - Text 0,20,"X Translation: "+x# - Text 0,40,"Y Translation: "+y# - Text 0,60,"Z Translation: "+z# +; Translate sphere using translation values +TranslateEntity cone,x#,y#,z# - Flip +; If spacebar pressed then rotate cone by random amount +If KeyHit( 57 )=True Then RotateEntity cone,Rnd( 0,360 ),Rnd( 0,360 ),Rnd( 0,360 ) + +RenderWorld + +Text 0,0,"Use cursor/A/Z keys to translate cone, spacebar to rotate cone by random amount" +Text 0,20,"X Translation: "+x# +Text 0,40,"Y Translation: "+y# +Text 0,60,"Z Translation: "+z# + +Flip Wend diff --git a/_release/help/commands/3d_examples/TurnEntity.bb b/_release/help/commands/3d_examples/TurnEntity.bb index 721a7d9..0d6928e 100644 --- a/_release/help/commands/3d_examples/TurnEntity.bb +++ b/_release/help/commands/3d_examples/TurnEntity.bb @@ -12,30 +12,30 @@ PositionEntity cone,0,0,5 While Not KeyDown( 1 ) - ; Reset turn values - otherwise, the cone will not stop turning! - pitch#=0 - yaw#=0 - roll#=0 +; Reset turn values - otherwise, the cone will not stop turning! +pitch#=0 +yaw#=0 +roll#=0 - ; Change movement values depending on the key pressed - If KeyDown( 208 )=True Then pitch#=-1 - If KeyDown( 200 )=True Then pitch#=1 - If KeyDown( 203 )=True Then yaw#=-1 - If KeyDown( 205 )=True Then yaw#=1 - If KeyDown( 45 )=True Then roll#=-1 - If KeyDown( 44 )=True Then roll#=1 +; Change movement values depending on the key pressed +If KeyDown( 208 )=True Then pitch#=-1 +If KeyDown( 200 )=True Then pitch#=1 +If KeyDown( 203 )=True Then yaw#=-1 +If KeyDown( 205 )=True Then yaw#=1 +If KeyDown( 45 )=True Then roll#=-1 +If KeyDown( 44 )=True Then roll#=1 - ; Move sphere using movement values - TurnEntity cone,pitch#,yaw#,roll# - - RenderWorld +; Move sphere using movement values +TurnEntity cone,pitch#,yaw#,roll# - Text 0,0,"Use cursor/Z/X keys to turn cone" - Text 0,20,"Pitch: "+pitch# - Text 0,40,"Yaw: "+yaw# - Text 0,60,"Roll: "+roll# +RenderWorld - Flip +Text 0,0,"Use cursor/Z/X keys to turn cone" +Text 0,20,"Pitch: "+pitch# +Text 0,40,"Yaw: "+yaw# +Text 0,60,"Roll: "+roll# + +Flip Wend diff --git a/_release/help/commands/3d_examples/Windowed3D.bb b/_release/help/commands/3d_examples/Windowed3D.bb index 9515569..0513ebf 100644 --- a/_release/help/commands/3d_examples/Windowed3D.bb +++ b/_release/help/commands/3d_examples/Windowed3D.bb @@ -1,11 +1,10 @@ - If Windowed3D () - Graphics3D 640, 480, 0, 2 - Print "Windowed mode!" +Graphics3D 640, 480, 0, 2 +Print "Windowed mode!" Else - Graphics3D 640, 480, 0, 1 - Print "Full screen modes only!" +Graphics3D 640, 480, 0, 1 +Print "Full screen modes only!" EndIf MouseWait -End +End \ No newline at end of file diff --git a/_release/help/commands/3d_examples/Wireframe.bb b/_release/help/commands/3d_examples/Wireframe.bb index e5cbd8d..3df450c 100644 --- a/_release/help/commands/3d_examples/Wireframe.bb +++ b/_release/help/commands/3d_examples/Wireframe.bb @@ -14,18 +14,18 @@ PositionEntity sphere,0,0,2 While Not KeyDown( 1 ) - ; Toggle wireframe enable value between true and false when spacebar is pressed - If KeyHit( 57 )=True Then enable=1-enable +; Toggle wireframe enable value between true and false when spacebar is pressed +If KeyHit( 57 )=True Then enable=1-enable - ; Enable/disable wireframe rendering - WireFrame enable +; Enable/disable wireframe rendering +WireFrame enable - RenderWorld +RenderWorld - Text 0,0,"Press spacebar to toggle between Wireframe True/False" - If enable=False Then Text 0,20,"Wireframe False" Else Text 0,20,"Wireframe True" +Text 0,0,"Press spacebar to toggle between Wireframe True/False" +If enable=True Then Text 0,20,"Wireframe True" Else Text 0,20,"Wireframe False" - Flip +Flip Wend diff --git a/_release/help/commands/command_list.htm b/_release/help/commands/command_list.htm index 8c53d35..af9c4f8 100644 --- a/_release/help/commands/command_list.htm +++ b/_release/help/commands/command_list.htm @@ -1,5285 +1,29 @@ - - - - - -Command Reference - - +Blitz3D Docs + - - - -

Command Ref.

- -

2D - Category
-3D - Category

- -

2D - A-Z
-3D - A-Z

- -

Scancodes

- -
- -

2D  - Category

- -

Basic:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- If
- Then
- Else
- ElseIf
- Else If
- EndIf
- End If
- Select
- Case
- Default
- End Select
- And
- Or
- Not
- Repeat
- Until
- Forever
- While
- Wend
- For
- To
- Step
- Next
- Exit
- Goto
- Gosub
.
- Return
- Function
- End Function
- Const
- Global
- Local
- Dim
- Type
- Field
- End Type
- New
- Each
- First
- Last
- Before
- After
- Insert
- Delete
Handle
Object
- True
- False
- Null
- Data
- Read
- Restore
- Include
-

Maths:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Pi
- Int
- Float
- -Floor
- -Ceil
-Sgn
-Abs
- Mod
-Sqr
Sin
- -Cos
- -Tan
- -ASin
- -ACos
- -ATan
- -ATan2
- -Exp
- -Log
- -Log10
- Xor
- Shl
- Shr
- Sar
-Rnd
-Rand
-SeedRnd
-

String:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Str
Left
- -Right
- -Mid
- -Replace
- -Instr
- -Upper
- -Lower
- -Trim
- -LSet
- -RSet
- -Chr
- -Asc
- -Len
- -Hex
- -Bin
- -String
-

Text:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -Print
- -Write
- -Text
- -LoadFont
- -SetFont
- -FreeFont
- -FontWidth
- -FontHeight
- -StringWidth
- -StringHeight
-

Input:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -Input
- -KeyDown
- -KeyHit
- -GetKey
- -WaitKey
- -FlushKeys
- -MoveMouse
- -MouseDown
- -MouseHit
- -GetMouse
- -WaitMouse
- -MouseX
- -MouseY
- -MouseZ
- -MouseXSpeed
- -MouseYSpeed
- -MouseZSpeed
- -FlushMouse
- -JoyType
- -JoyHit
- -GetJoy
- -WaitJoy
- -JoyX
- -JoyY
- -JoyZ
- -JoyXDir
- -JoyYDir
- -JoyZDir
- -FlushJoy
-

Bank:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -CreateBank
- -FreeBank
- -BankSize
- -ResizeBank
- -CopyBank
- -PeekByte
- -PeekShort
- -PeekInt
- -PeekFloat
- -PokeByte
- -PokeShort
- -PokeInt
- -PokeFloat
-

File/Stream:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OpenFile
- -ReadFile
- -WriteFile
- -CloseFile
- -FilePos
- -SeekFile
- -ReadDir
- -CloseDir
- -NextFile
- -CurrentDir
- -ChangeDir
- -CreateDir
- -DeleteDir
- -FileType
- -FileSize
- -CopyFile
- -DeleteFile
- -ExecFile
-OpenTCPStream
- -CopyStream
- -CloseTCPStream
- -CreateTCPServer
- -AcceptTCPStream
- -CloseTCPServer
- -TCPTimeouts
- -Eof
- -ReadAvail
- -ReadByte
- -ReadShort
- -ReadInt
- -ReadFloat
- -ReadString
- -ReadLine
- -ReadBytes
- -WriteByte
- -WriteShort
- -WriteInt
- -WriteFloat
- -WriteString
- -WriteLine
- -WriteBytes
-

Multiplayer:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StartNetGame
- -HostNetGame
-JoinNetGame
- -StopNetGame
- -CreateNetPlayer
- -DeleteNetPlayer
- -NetPlayerName
- -NetPlayerLocal
- -RecvNetMsg
- -NetMsgType
- -NetMsgFrom
- -NetMsgTo
- -NetMsgData
- -SetNetMsg
-

Sounds/Music:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - LoadSound
- -FreeSound
- -LoopSound
- -SoundPitch
- -SoundVolume
- -SoundPan
- -PlaySound
- -PlayMusic
- -PlayCDTrack
- -StopChannel
- -PauseChannel
- -ResumeChannel
- -ChannelPitch
- -ChannelVolume
- -ChannelPan
- -ChannelPlaying
-

Graphics:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Graphics
- -SetBuffer
- -FrontBuffer
- -BackBuffer
- -LoadBuffer
- -SaveBuffer
- -LockBuffer
- -UnlockBuffer
- -ReadPixel
- -WritePixel
- -ReadPixelFast
- -WritePixelFast
- -CopyPixel
- -CopyPixelFast
-CopyRect
- -Viewport
- -Origin
- -Flip
- -VWait
- -Scanline
- -GraphicsHeight
- -GraphicsWidth
- -GraphicsDepth
- -GraphicsBuffer
- -Color
- -ClsColor
- -Cls
- -Plot
- -Line
- -Rect
- -Oval
- -GetColor
- -ColorRed
- -ColorGreen
- -ColorBlue
- -CountGfxModes
-CountGfxDrivers
- -GfxDriverName
- -SetGfxDriver
- -GfxModeWidth
- -GfxModeHeight
- -GfxModeDepth
- -GfxModeExists
- -TotalVidMem
- -AvailVidMem
-

Image:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LoadImage
- -CopyImage
- -CreateImage
- -LoadAnimImage
- -FreeImage
- -SaveImage
- -GrabImage
- -ImageBuffer
- -DrawImage
- -DrawImageRect
- -DrawBlockRect
- -DrawBlock
- -TileImage
- -TileBlock
- -MaskImage
- -HandleImage
- -MidHandle
- -AutoMidHandle
- -ScaleImage
- -ResizeImage
- -RotateImage
- -TFormImage
- -TFormFilter
- -ImageWidth
- -ImageHeight
- -ImageXHandle
- -ImageYHandle
- -ImagesOverlap
- -ImagesCollide
- -RectsOverlap
- -ImageRectOverlap
- -ImageRectCollide
-

Time:

- - - - - - - - - - - - - - - - - - - - - - -
Millisecs
- -Delay
- -CurrentDate
- -CurrentTime
- -CreateTimer
- -FreeTimer
- -WaitTimer
-

Windows/Debug:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-CommandLine
-ShowPointer
-HidePointer
- -AppTitle
- -RuntimeError
-DebugLog
- -Stop
- -End
-
-

3D - Category

-

Global:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Graphics3D
- -Dither
- -WBuffer
- -AntiAlias
- -Wireframe
- -HWMultiTex
- -AmbientLight
- -ClearCollisions
- -Collisions
- -UpdateWorld
- -CaptureWorld
- -RenderWorld
- -ClearWorld
- -LoaderMatrix
-

Texture:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CreateTexture
-LoadTexture
-LoadAnimTexture
-FreeTexture
-TextureBlend
-TextureCoords
-ScaleTexture
- PositionTexture
-RotateTexture
-TextureWidth
-TextureHeight
-TextureBuffer
-ClearTextureFilters
-TextureFilter
-

Brush:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CreateBrush
-LoadBrush
-FreeBrush
-BrushColor
-BrushAlpha
-BrushShininess
-BrushTexture
-BrushBlend
-BrushFX
-

Mesh:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CreateMesh
-LoadMesh
-LoadAnimMesh
-CreateCube
-CreateSphere
-CreateCylinder
-CreateCone
-FlipMesh
-PaintMesh
-LightMesh
-FitMesh
-ScaleMesh
-RotateMesh
-PositionMesh
-UpdateNormals
-MeshesIntersect
-MeshWidth
-MeshHeight
-MeshDepth
-CountSurfaces
-GetSurface
-

Surface:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CreateSurface
-PaintSurface
-ClearSurface
-FindSurface
-AddVertex
-AddTriangle
-VertexCoords
-VertexNormal
-VertexColor
-VertexTexCoords
-CountVertices
-CountTriangles
-VertexX
-VertexY
-VertexZ
-VertexNX
-VertexNY
-VertexNZ
-VertexRed
-VertexGreen
-VertexBlue
-VertexU
-VertexV
-VertexW
-TriangleVertex
-

Camera:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CreateCamera
-CameraFogMode
-CameraFogRange
-CameraFogColor
-CameraViewport
-CameraClsMode
-CameraClsColor
-CameraRange
-CameraZoom
-CameraPick
-PickedX
-PickedY
-PickedZ
-PickedNX
-PickedNY
-PickedNZ
-PickedTime
-PickedEntity
-PickedSurface
-PickedTriangle
-CameraProject
-ProjectedX
-ProjectedY
-ProjectedZ
-EntityInView
-

Light:

- - - - - - - - - - - - - -
CreateLight
-LightRange
-LightColor
-LightConeAngles
-

Pivot:

- - - - -
CreatePivot
-

Sprite:

- - - - - - - - - - - - - - - - - - - -
CreateSprite
-LoadSprite
-RotateSprite
-ScaleSprite
-HandleSprite
-SpriteViewMode
-

MD2:

- - - - - - - - - - - - - - - - -
LoadMD2
-AnimateMD2
-MD2AnimTime
-MD2AnimLength
-MD2Animating
-

Plane:

- - - - -
CreatePlane
-

Mirrror:

- - - - -
CreateMirror
-

Terrain:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CreateTerrain
-LoadTerrain
-TerrainSize
-TerrainDetail
-TerrainShading
-TerrainHeight
-ModifyTerrain
-TerrainX
-TerrainY
-TerrainZ
-

Listener/Audio Commands:

- - - - - - - - - - -
CreateListener
-Load3DSound
-EmitSound
-

EntityMovement:

- - - - - - - - - - - - - - - - - - - - - - - - - -
- -ScaleEntity
- -PositionEntity
- -MoveEntity
- -TranslateEntity
- -RotateEntity
- -TurnEntity
- -PointEntity
- -AlignToVector
-

Entity Animation:

- - - - - - - - - - - - - - - - - - - - - - - - - -
LoadAnimSeq
-SetAnimKey
-AddAnimSeq
-Animate
-AnimSeq
-AnimLength
-AnimTime
-Animating
-

Entity Control:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FreeEntity
-CopyEntity
-EntityColor
-EntityAlpha
-EntityShininess
-EntityTexture
-EntityBlend
-EntityFX
-EntityAutoFade
-PaintEntity
-EntityOrder
-ShowEntity
-HideEntity
-NameEntity
-EntityParent
-GetParent
-

Entity State:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EntityX
-EntityY
-EntityZ
-EntityRoll
-EntityYaw
-EntityPitch
-EntityName
-CountChildren
-GetChild
-FindChild
-EntityPick
-LinePick
-EntityVisible
-EntityDistance
-TFormPoint
-TFormVector
-TFormNormal
-TFormedX
-TFormedY
-TFormedZ
-EntityAnimating
-EntityAnimTime
- -

Entity Collision:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ResetEntity
-EntityRadius
-EntityBox
-EntityType
-EntityPickMode
-EntityCollided
-CountCollisions
-CollisionX
-CollisionY
-CollisionZ
-CollisionNX
-CollisionNY
-CollisionNZ
-CollisionTime
-CollisionEntity
-CollisionSurface
-CollisionTriangle
-GetEntityType
-

Graphics Mode:

- - - - - - - - - - - - - - - - -
GfxModeExists
- -GfxDriver3D
- -GfxMode3D
- -Windowed3D
- -
-

2D - A-Z

-

.

- - - - -
.
-

A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -Abs
- -AcceptTCPStream
- -ACos
-After
-And
- -AppTitle
- -Asc
- -ASin
- -ATan
- -ATan2
- -AutoMidHandle
- -AvailVidMem
-

-B

- - - - - - - - - - - - - -
- -BackBuffer
- -BankSize
-Before
- -Bin
-

-C

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Case
- -Ceil
- -ChangeDir
- -ChannelPan
- -ChannelPitch
- -ChannelPlaying
- -ChannelVolume
- -Chr
- -CloseDir
- -CloseFile
- -CloseTCPServer
- -CloseTCPStream
- -Cls
- -ClsColor
- -Color
- -CopyBank
- -ColorBlue
- -ColorGreen
- -ColorRed
- -CommandLine
-Const
- -CopyFile
- -CopyImage
- -CopyPixel
- -CopyPixelFast
-CopyRect
- -CopyStream
- -Cos
-CountGfxDrivers
- -CountGfxModes
- -CreateBank
- -CreateDir
- -CreateImage
- -CreateNetPlayer
- -CreateTCPServer
- -CreateTimer
- -CurrentDate
- -CurrentDir
- -CurrentTime
-

-D

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Data
- -DebugLog
-Default
- -Delay
-Delete
- -DeleteDir
- -DeleteFile
- -DeleteNetPlayer
-Dim
- -DrawBlock
- -DrawBlockRect
- -DrawImage
- -DrawImageRect
-

-E

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Each
-Else
- -Else If
-ElseIf
- -End
- -End Function
- -End If
- -End Select
- -End Type
-EndIf
- -Eof
- -ExecFile
-Exit
- -Exp
-

-F

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-False
-Field
- -FilePos
- -FileSize
- -FileType
-First
- -Flip
-Float
- -Floor
- -FlushJoy
- -FlushKeys
- -FlushMouse
- -FontHeight
- -FontWidth
-For
-Forever
- -FreeBank
- -FreeFont
- -FreeImage
- -FreeSound
- -FreeTimer
- -FrontBuffer
- -Function
-

-G

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -GetColor
- -GetJoy
- -GetKey
- -GetMouse
- -GfxDriverName
- -GfxModeDepth
- -GfxModeExists
- -GfxModeHeight
- -GfxModeWidth
- -Global
-Gosub
-Goto
- -GrabImage
- -Graphics
- -GraphicsBuffer
- -GraphicsDepth
- -GraphicsHeight
- -GraphicsWidth
-

-H

- - - - - - - - - - - - - - - - -
-Handle
- -HandleImage
- -Hex
- -HidePointer
- -HostNetGame
-

-I

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-If
- -ImageBuffer
- -ImageHeight
- -ImageRectCollide
- -ImageRectOverlap
- -ImagesCollide
- -ImagesOverlap
- -ImageWidth
- -ImageXHandle
- -ImageYHandle
- -Include
- -Input
- -Insert
- -Instr
-Int
-

-J

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-JoinNetGame
- -JoyHit
- -JoyType
- -JoyX
- -JoyY
- -JoyZ
- -JoyXDir
- -JoyYDir
- -JoyZDir
-

-K

- - - - - - - -
- -KeyDown
- -KeyHit
-

-L

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -Last
- -Left
- -Len
- -Line
- -LoadAnimImage
- -LoadBuffer
- -LoadFont
- -LoadImage
- -LoadSound
- -Local
- -LockBuffer
- -Log
- -Log10
- -LoopSound
- -Lower
- -LSet
-

-M

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -MaskImage
- -Mid
- -MidHandle
- -Millisecs
-Mod
- -MouseDown
- -MouseHit
- -MouseX
- -MouseY
- -MouseZ
- -MouseXSpeed
- -MouseYSpeed
- -MouseZSpeed
- -MoveMouse
-

-N

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -NetMsgData
- -NetMsgFrom
- -NetMsgTo
- -NetMsgType
- -NetPlayerLocal
- -NetPlayerName
-New
- -Next
- -NextFile
-Not
- -Null
-

-O

- - - - - - - - - - - - - - - - - - - -
-Object
- -OpenFile
-OpenTCPStream
-Or
- -Origin
- -Oval
-

-P

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -PauseChannel
- -PeekByte
- -PeekFloat
- -PeekInt
- -PeekShort
-Pi
- -PlayCDTrack
- -PlayMusic
- -PlaySound
- -Plot
- -PokeByte
- -PokeFloat
- -PokeInt
- -PokeShort
- -Print
-

-R

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -Rand
- -Read
- -ReadAvail
- -ReadByte
- -ReadBytes
- -ReadDir
- -ReadFile
- -ReadFloat
- -ReadInt
- -ReadLine
- -ReadPixel
- -ReadPixelFast
- -ReadShort
- -ReadString
- -Rect
- -RectsOverlap
- -RecvNetMsg
- -Repeat
- -Replace
- -ResizeBank
- -ResizeImage
- -Restore
- -ResumeChannel
- -Return
- -Right
- -Rnd
- -RotateImage
- -RSet
- -RuntimeError
-

-S

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Sar
- -SaveBuffer
- -SaveImage
- -ScaleImage
- -Scanline
- -SeedRnd
- -SeekFile
- -Select
- -SetBuffer
- -SetFont
- -SetGfxDriver
- -SetNetMsg
- -Sgn
-Shl
- -ShowPointer
-Shr
- -Sin
- -SoundPan
- -SoundPitch
- -SoundVolume
- -Sqr
- -StartNetGame
- -Step
- -Stop
- -StopChannel
- -StopNetGame
-Str
- -String
- -StringHeight
- -StringWidth
-

-T

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -Tan
- -TCPTimeouts
- -Text
- -TFormFilter
- -TFormImage
- -Then
- -TileBlock
- -TileImage
-To
- -TotalVidMem
- -Trim
- -True
- -Type
-

-U

- - - - - - - - - - -
- -UnlockBuffer
- -Until
- -Upper
-

-V

- - - - - - - -
- -Viewport
- -VWait
-

-W

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -WaitJoy
- -WaitKey
- -WaitMouse
- -WaitTimer
- -Wend
- -While
- -Write
- -WriteByte
- -WriteBytes
- -WriteFile
- -WriteFloat
- -WriteInt
- -WriteLine
- -WritePixel
- -WritePixelFast
- -WriteShort
- -WriteString
-

X

- - - - - - - -
-Xor
 
-
-

3D - A-Z

-

A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -AddAnimSeq
- -AddTriangle
- -AddVertex
- -AlignToVector
- -AmbientLight
- -Animate
- -AnimateMD2
- -Animating
- -AnimLength
- -AnimSeq
- -AnimTime
- -AntiAlias
-

-B

- - - - - - - - - - - - - - - - - - - - -
- -BrushAlpha
- -BrushBlend
- -BrushColor
- -BrushFX
- -BrushShininess
- -BrushTexture
-

- -C

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -CameraClsColor
- -CameraClsMode
- -CameraFogColor
- -CameraFogMode
- -CameraFogRange
- -CameraPick
- -CameraProject
- -CameraRange
- -CameraViewport
- -CameraZoom
- -CaptureWorld
- -ClearCollisions
- -ClearSurface
- -ClearTextureFilters
- -ClearWorld
- -CollisionEntity
- -CollisionNX
- -CollisionNY
- -CollisionNZ
- -Collisions
- -CollisionSurface
- -CollisionTime
- -CollisionTriangle
- -CollisionX
- -CollisionY
- -CollisionZ
- -CopyEntity
- -CountChildren
- -CountCollisions
- -CountSurfaces
- -CountTriangles
- -CountVertices
- -CreateBrush
- -CreateCamera
- -CreateCone
- -CreateCube
- -CreateCylinder
- -CreateLight
- -CreateListener
- -CreateMesh
- -CreateMirror
- -CreatePivot
- -CreatePlane
- -CreateSphere
- -CreateSprite
- -CreateSurface
- -CreateTerrain
- -CreateTexture
- -

-D

- - - - - -
- -Dither
- -

- -E

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -EmitSound
- -EntityAlpha
- -EntityAnimating
- -EntityAnimTime
- -EntityAutoFade
- -EntityBlend
- -EntityBox
- -EntityCollided
- -EntityColor
- -EntityDistance
- -EntityFX
- -EntityInView
- -EntityName
- -EntityOrder
- -EntityParent
- -EntityPick
- -EntityPickMode
- -EntityPitch
- -EntityRadius
- -EntityRoll
- -EntityShininess
- -EntityTexture
- -EntityType
- -EntityVisible
- -EntityX
- -EntityY
- -EntityYaw
- -EntityZ
- -

- -F

- - - - - - - - - - - - - - - - - - - - - - - -
- -FindChild
- -FindSurface
- -FitMesh
- -FlipMesh
- -FreeBrush
- -FreeEntity
- -FreeTexture
- -

- -G

- - - - - - - - - - - - - - - - - - - - - - - - - - -
- -GetChild
- -GetEntityType
- -GetParent
- -GetSurface
- -GfxDriver3D
- -GfxMode3D
- -GfxModeExists
- -Graphics3D
- -

- -H

- - - - - - - - - - - -
- -HandleSprite
- -HideEntity
- -HWMultiTex
- -

- -L

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -LightColor
- -LightConeAngles
- -LightMesh
- -LightRange
- -LinePick
- -Load3DSound
- -LoadAnimMesh
- -LoadAnimSeq
- -LoadAnimTexture
- -LoadBrush
- -LoaderMatrix
- -LoadMD2
- -LoadMesh
- -LoadSprite
- -LoadTerrain
- -LoadTexture
- -

- -M

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -MD2Animating
- -MD2AnimLength
- -MD2AnimTime
- -MeshesIntersect
- -MeshDepth
- -MeshHeight
- -MeshWidth
- -ModifyTerrain
- -MoveEntity
- -

- -N

- - - - - -
- -NameEntity
- -

- -P

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -PaintEntity
- -PaintMesh
- -PaintSurface
- -PickedEntity
- -PickedNX
- -PickedNY
- -PickedNZ
- -PickedSurface
- -PickedTime
- -PickedTriangle
- -PickedX
- -PickedY
- -PickedZ
- -PointEntity
- -PositionEntity
- -PositionMesh
- -PositionTexture
- -ProjectedX
- -ProjectedY
- -ProjectedZ
- -

- -R

- - - - - - - - - - - - - - - - - - - - -
- -RenderWorld
- -ResetEntity
- -RotateEntity
- -RotateMesh
- -RotateSprite
- -RotateTexture
- -

- -S

- - - - - - - - - - - - - - - - - - - - - - - -
- -ScaleEntity
- -ScaleMesh
- -ScaleSprite
- -ScaleTexture
- -SetAnimKey
- -ShowEntity
- -SpriteViewMode
- -

- -T

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -TerrainDetail
- -TerrainHeight
- -TerrainShading
- -TerrainSize
- -TerrainX
- -TerrainY
- -TerrainZ
- -TextureBlend
- -TextureBuffer
- -TextureCoords
- -TextureFilter
- -TextureHeight
- -TextureWidth
- -TFormedX
- -TFormedY
- -TFormedZ
- -TFormNormal
- -TFormPoint
- -TFormVector
- -TranslateEntity
- -TriangleVertex
- -TurnEntity
- -

- -U

- - - - - - - - -
- -UpdateNormals
- -UpdateWorld
- -

- -V

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -VertexBlue
- -VertexColor
- -VertexCoords
- -VertexGreen
- -VertexNormal
- -VertexNX
- -VertexNY
- -VertexNZ
- -VertexRed
- -VertexTexCoords
- -VertexU
- -VertexV
- -VertexW
- -VertexX
- -VertexY
- -VertexZ
- -

- -W

- - - - - - - - - - - -
- -WBuffer
- -Windowed3D
- -Wireframe
- + +

Command Ref.

+2D - Category +
+3D - Category +
+
+2D - A-Z +
+3D - A-Z +
+
+ASCII Codes +
+
+Scancodes +
+Scancodes Picker +
+
+Index +
- - \ No newline at end of file + diff --git a/_release/help/commands/css/commands.css b/_release/help/commands/css/commands.css index ef96bae..74d9ccf 100644 --- a/_release/help/commands/css/commands.css +++ b/_release/help/commands/css/commands.css @@ -1,11 +1,55 @@ -.Command { font-family: Verdana, Arial; font-size: small; font-weight: bold; color: #ffffff; background-color: #11AABB; border: solid; border-width: 0px 0px 0px 0pt; border-color: black black black #FFFFFF} +body +{ + color: #ffffff; + font: 10pt verdana; + background: #003d78; +} -body { font-family: Verdana, Arial; font-size: x-small; color: #000000; background-color: #005070} +h1 +{ + font: bold 10pt verdana; +} -.header { font-family: Verdana, Arial; font-size: x-small; font-weight: bold; color: #00ff00} +table +{ + font: 8pt verdana; + background: #003566; + width: 100%; +} -td { font-family: Verdana, Arial; font-size: x-small; color: #ffffff; background-color: #117799; border: solid; border-width: 0px 0px 0px 0pt; border-color: black black black #FFFFFF} +a +{ + color: #fff000; + font: 10pt verdana; + text-decoration: none; +} -a:link {color: #ffff00; text-decoration: none} -a:visited {color: #ffff00; text-decoration: none} -a:hover {color: #00ff00; text-decoration: underline} +a:hover +{ + color: #fff000; + font: 10pt verdana; + background: #0088ee; + text-decoration: none; +} + +a.small +{ + color: #fff000; + font: 8pt verdana; + text-decoration: none; +} + +a.small:hover +{ + color: #fff000; + font: 8pt verdana; + background: #0088ee; + text-decoration: none; +} + +pre.code +{ + color: #44ff00; + background: #000000; + margin: 8px; +} \ No newline at end of file diff --git a/_release/help/commands/index.htm b/_release/help/commands/index.htm index 44a216c..436fd0c 100644 --- a/_release/help/commands/index.htm +++ b/_release/help/commands/index.htm @@ -1,19 +1,16 @@ - - -New Page 1 - +Blitz Docs - + - + <body> - <p>This page uses frames, but your browser doesn't support them.</p> + <p>This page uses frames, but your browser doesn&#39;t support them.</p> </body> diff --git a/_release/help/commands/scancodes.htm b/_release/help/commands/scancodes.htm index b654be8..e73b938 100644 --- a/_release/help/commands/scancodes.htm +++ b/_release/help/commands/scancodes.htm @@ -5,740 +5,741 @@ -Scanocdes +Scancodes - + -

  Scancodes  

- - +

Scancodes

+
+ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
KEYBOARD KEY SCANCODE COMMENTS
ESCAPE 1  
1 2  
2 3  
3 4  
4 5  
5 6  
6 7  
7 8  
8 9  
9 10  
0 11  
Minus (-) 12 On Main Keyboard
Equals (=) 13  
Backspace 14 Backspace key
Tab 15  
Q 16  
W 17  
E 18  
R 19  
T 20  
Y 21  
U 22  
I 23  
O 24  
P 25  
Left Bracket ([) 26  
Right Bracket (]) 27  
Return/Enter 28 Return/Enter on Main Keyboard
Left Control 29  
A 30  
S 31  
D 32  
F 33  
G 34  
H 35  
J 36  
K 37  
L 38  
Semi-Colon (;) 39  
Apostrophe (')
Apostrophe (') 40  
Grave 41 Accent GraveAccent Grave
Left Shift 42  
Backslash (\) 43  
Z 44  
X 45  
C 46  
V 47  
B 48  
N 49  
M 50  
Comma (,) 51  
Period (.) 52 On Main keyboard
Slash (/) 53 On Main Keyboard
Right Shift 54  
Multiply (*) 55 On Numeric Keypad
Left Alt/Menu 56  
Space 57  
Capital 58  
F1 59  
F2 60  
F3 61  
F4 62  
F5 63  
F6 64  
F7 65  
F8 66  
F9 67  
F10 68  
NumLock 69  
Scroll Lock 70  
NumPad 7 71  
NumPad 8 72  
NumPad 9 73  
Subtract (-) 74 On Numeric Keypad
NumPad 4 75  
NumPad 5 76  
NumPad 6 77  
Add (+) 78 On Numeric Keypad
NumPad 1 79  
NumPad 2 80  
NumPad 3 81  
NumPad 0 82  
Decimal (.) 83 On Numeric Keypad
OEM_102 86 On UK/Germany Keyboards
F11 87  
F12 88  
F13 100 (NEC PC98)
F14 101 (NEC PC98)
F15 102 (NEC PC98)
Kana 112 Japanese Keyboard
ABNT_C1 115 /? on Portugese (Brazilian) keyboards
Convert 121 Japanese Keyboard
NoConvert 123 Japanese Keyboard
Yen 125 Japanese Keyboard
ABNT_C2 126 Numpad . on Portugese (Brazilian) keyboards
Equals 141 = on numeric keypad (NEC PC98)
PrevTrack 144 Previous Track (DIK_CIRCUMFLEX on Japanese keyboard)
AT 145 (NEC PC98)
Colon (:) 146 (NEC PC98)
Underline 147 (NEC PC98)
Kanji 148 Japanese Keyboard
Stop 149 (NEC PC98)
AX 150 Japan AX
Unlabeled 151 (J3100)
Next Track 153 Next Track
Enter 156 ENTER on Numeric Keypad
Right Control 157  
Mute 160 Mute
Calculator 161 Calculator
Play/Pause 162 Play/Pause
Media Stop 164 Media Stop
Volume Down 174 Volume -
Volume Up 176 Volume +
Web Home 178 Web Home
Comma (,) 179 On Numeric Keypad (NEX PC98)
Divide (/) 181 On Numeric Keypad
SysReq 183  
Right Alt/Menu 184 Right Alt
Pause 197 Pause
Home 199 Home on Arrow Pad
Up 200 Up Arrow on Arrow Keypad
Page Up/Prior 201 Page Up on Arrow Keypad
Left 203 Left Arrow on Arrow Keypad
Right 205 Right Arrow on Arrow Keypad
End 207 End Key on Arrow Keypad
Down 208 Down Key on Arrow Keypad
Next 209 Next Key on Arrow Keypad
Insert 210 Insert Key on Arrow Keypad
Delete 211 Delete Key on Arrow Keypad
Left Windows 219 Left Windows Key
Right Windows 220 Right Windows Key
Apps 221 Apps Menu Key
Power 222 System Power
Sleep 223 System Sleep
Wake 227 System Wake
Web Search 229  
Web Favorites 230  
Web Refresh 231  
Web Stop 232  
Web Forward 233  
Web Back 234  
My Computer 235  
Mail 236  
Media Select 237  
+

Index