Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- JointConstructor:setActors
- JointConstructor:setJointTransforms
- addDifferential
- addForce
- addImpulse
- addTorque
- addTorqueImpulse
- addVehicleLink
- computeWheelShapeTireForces
- createCCT
- createWheelShape
- getAngularDamping
- getAngularVelocity
- getCCTCollisionFlags
- getCenterOfMass
- getCollisionMask
- getDensity
- getLinearDamping
- getLinearVelocity
- getMass
- getMotorRotationSpeed
- getRigidBodyType
- getVelocityAtLocalPos
- getVelocityAtWorldPos
- getVolume
- getWheelShapeAxleSpeed
- getWheelShapeContactForce
- getWheelShapeContactNormal
- getWheelShapeContactObject
- getWheelShapeContactPoint
- getWheelShapePosition
- getWheelShapeSlip
- moveCCT
- overlapBox
- overlapSphere
- raycastAll
- raycastClosest
- removeCCT
- setAngularDamping
- setAngularVelocity
- setCenterOfMass
- setCollisionMask
- setFrictionVelocity
- setJointDrive
- setLinearDamping
- setLinearVelocity
- setMass
- setRigidBodyType
- setSolverIterationCount
- setWheelShapeForcePoint
- setWheelShapeProps
- setWheelShapeTireFriction
- simulatePhysics
- simulatePhysicsTimeScale
- updateDifferential
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
FlowLayoutElement
DescriptionHorizontal flow layouting element for simple cases.Parent
BoxLayoutElementFunctions
invalidateLayout
DescriptionDefinitioninvalidateLayout()Code
27 | function FlowLayoutElement:invalidateLayout(ignoreVisibility) |
28 | local totalWidth = 0 |
29 | for _, element in pairs(self.elements) do |
30 | if self:getIsElementIncluded(element, ignoreVisibility) then |
31 | totalWidth = totalWidth + element.size[1] + element.margin[1] + element.margin[3] |
32 | end |
33 | end |
34 | |
35 | local posX = 0 |
36 | if self.alignmentX == FlowLayoutElement.ALIGN_CENTER then |
37 | posX = self.size[1]*0.5 - totalWidth*0.5 |
38 | elseif self.alignmentX == FlowLayoutElement.ALIGN_RIGHT then |
39 | posX = self.size[1] - totalWidth |
40 | end |
41 | |
42 | for _, element in pairs(self.elements) do |
43 | if self:getIsElementIncluded(element, ignoreVisibility) then |
44 | posX = posX + element.margin[1] |
45 | local posY = element.margin[4] |
46 | if self.alignmentY == FlowLayoutElement.ALIGN_MIDDLE then |
47 | posY = self.size[2]*0.5 - element.size[2]*0.5 |
48 | elseif self.alignmentY == FlowLayoutElement.ALIGN_TOP then |
49 | posY = self.size[2] - element.size[2] |
50 | end |
51 | |
52 | element:setPosition(posX, posY) |
53 | posX = posX + element.size[1] + element.margin[3] |
54 | end |
55 | end |
56 | end |
new
DescriptionDefinitionnew()Code
16 | function FlowLayoutElement:new(target, custom_mt) |
17 | local self = BoxLayoutElement:new(target, custom_mt or FlowLayoutElement_mt) |
18 | |
19 | self.alignmentX = BoxLayoutElement.ALIGN_LEFT |
20 | self.alignmentY = BoxLayoutElement.ALIGN_BOTTOM |
21 | |
22 | return self |
23 | end |