GetScreenFromWorldPosition: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Clarified parameter descriptions) |
||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float float getScreenFromWorldPosition ( float x, float y, float z [ | float float getScreenFromWorldPosition ( float x, float y, float z, [ float edgeTolerance=0, bool relative=true ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 16: | Line 16: | ||
{{OptionalArg}} | {{OptionalArg}} | ||
{{New feature|3|1.0| | {{New feature|3|1.0| | ||
*'''edgeTolerance:''' A [[float]] value indicating the | *'''edgeTolerance:''' A [[float]] value indicating the distance the position can be off screen before the function returns false. | ||
*'''relative:''' A [[boolean]] value that indicates if | *'''relative:''' A [[boolean]] value that indicates if edgeTolerance is in pixels [false], or relative to the screen size [true]. | ||
}} | }} | ||
Revision as of 00:19, 8 June 2009
This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use processLineOfSight for that).
Syntax
float float getScreenFromWorldPosition ( float x, float y, float z, [ float edgeTolerance=0, bool relative=true ] )
Required Arguments
- x: A float value indicating the x position in the world.
- y: A float value indicating the y position in the world.
- z: A float value indicating the z position in the world.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- edgeTolerance: A float value indicating the distance the position can be off screen before the function returns false.
- relative: A boolean value that indicates if edgeTolerance is in pixels [false], or relative to the screen size [true].
Returns
Returns two x, y floats indicating the screen position if successful, false otherwise.
See Also
- createSWATRope
- getBirdsEnabled
- getCoronaReflectionsEnabled
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGroundPosition
- getInteriorFurnitureEnabled
- getNearClipDistance
- getPedsLODDistance
- getRoofPosition
- getScreenFromWorldPosition
- getVehiclesLODDistance
- getWorldFromScreenPosition
- isAmbientSoundEnabled
- isLineOfSightClear
- isWorldSoundEnabled
- processLineOfSight
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetNearClipDistance
- resetPedsLODDistance
- resetVehiclesLODDistance
- resetWorldSounds
- setAmbientSoundEnabled
- setBirdsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setNearClipDistance
- setPedsLODDistance
- setVehiclesLODDistance
- setWorldSoundEnabled
- testLineAgainstWater
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel