Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Debug2DArea
- DebugBitVectorMap
- DebugCube
- DebugDensityMap
- DebugFlag
- DebugGizmo
- DebugInfoTable
- DebugManager
- DebugPath
- DebugPoint
- DebugText
- DebugUtil
- NoteManager
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
DebugFlag
Functionscreate
DescriptionDefinitioncreate()Code
80 | function DebugFlag:create(x, y, z, dirX, dirZ) |
81 | self.x, self.y, self.z = x, y, z |
82 | self.dirX, self.dirZ = dirX, dirZ |
83 | |
84 | return self |
85 | end |
draw
DescriptionDefinitiondraw()Code
51 | function DebugFlag:draw() |
52 | local x, y, z = self.x, self.y, self.z |
53 | local tx = x + self.dirX * self.flagLength |
54 | local tz = z + self.dirZ * self.flagLength |
55 | |
56 | local r = self.r |
57 | local g = self.g |
58 | local b = self.b |
59 | |
60 | drawDebugLine(x, y, z, r, g, b, x, y+self.height, z, r, g, b) |
61 | |
62 | local posYStart = y + self.height - self.flagHeight |
63 | local posYEnd = y + self.height |
64 | for i=1, self.numSectionsZ do |
65 | local offset = self.flagLength * (i / self.numSectionsZ) |
66 | local lx = x + self.dirX * offset |
67 | local lz = z + self.dirZ * offset |
68 | drawDebugLine(lx, posYStart, lz, r, g, b, lx, posYEnd, lz, r, g, b) |
69 | end |
70 | |
71 | for i=0, self.numSectionsY do |
72 | local offset = self.flagHeight * (i / self.numSectionsY) |
73 | local ly = posYStart + offset |
74 | drawDebugLine(x, ly, z, r, g, b, tx, ly, tz, r, g, b) |
75 | end |
76 | end |
new
DescriptionDefinitionnew()Code
16 | function DebugFlag.new(r, g, b, customMt) |
17 | local self = setmetatable({}, customMt or DebugFlag_mt) |
18 | |
19 | self.x, self.y, self.z = 0, 0, 0 |
20 | self.dirX, self.dirZ = 0, 1 |
21 | self.r = r or 0 |
22 | self.g = g or 0 |
23 | self.b = b or 0 |
24 | |
25 | self.height = 4 |
26 | self.flagHeight = 0.7 |
27 | self.flagLength = 1 |
28 | |
29 | self.numSectionsY = 4 |
30 | self.numSectionsZ = 6 |
31 | |
32 | return self |
33 | end |