GetScreenFromWorldPosition: Difference between revisions
Jump to navigation
Jump to search
Paul Cortez (talk | contribs) m (Added default values for optional arguments.) |
mNo edit summary |
||
Line 16: | Line 16: | ||
{{OptionalArg}} | {{OptionalArg}} | ||
{{New feature|3|1.0| | {{New feature|3|1.0| | ||
*'''edgeTolerance:''' A float value indicating the tolerance which is used to calculate the screen position of positions that are slightly off-screen | *'''edgeTolerance:''' A [[float]] value indicating the tolerance which is used to calculate the screen position of positions that are slightly off-screen | ||
*'''relative:''' | *'''relative:''' A [[boolean]] value that indicates if the returned x/y positions are relative to the screen size | ||
}} | }} | ||
Revision as of 21:29, 7 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=false] )
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 tolerance which is used to calculate the screen position of positions that are slightly off-screen
- relative: A boolean value that indicates if the returned x/y positions are relative to the screen size
Returns
Returns two x, y floats indicating the screen position if successful, false otherwise.
See Also
- areTrafficLightsLocked
- createSWATRope
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getBirdsEnabled
- getCloudsEnabled
- getCoronaReflectionsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGravity
- getGroundPosition
- getHeatHaze
- getInteriorFurnitureEnabled
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getNearClipDistance
- getOcclusionsEnabled
- getPedsLODDistance
- getPlayerBlurLevel
- getRainLevel
- getRoofPosition
- getScreenFromWorldPosition
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getVehiclesLODDistance
- getWeather
- getWindVelocity
- getWorldFromScreenPosition
- getZoneName
- isAmbientSoundEnabled
- isGarageOpen
- isLineOfSightClear
- isWorldSoundEnabled
- isWorldSpecialPropertyEnabled
- processLineOfSight
- removeWorldModel
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetNearClipDistance
- resetPedsLODDistance
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetVehiclesLODDistance
- resetWindVelocity
- resetWorldSounds
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setAmbientSoundEnabled
- setBirdsEnabled
- setCloudsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setJetpackMaxHeight
- setMinuteDuration
- setMoonSize
- setNearClipDistance
- setOcclusionsEnabled
- setPedsLODDistance
- setPlayerBlurLevel
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightsLocked
- setTrafficLightState
- setVehiclesLODDistance
- setWeather
- setWeatherBlended
- setWindVelocity
- setWorldSoundEnabled
- setWorldSpecialPropertyEnabled
- testLineAgainstWater