DrawableSkybox

Extends: BGE.Image

Draws a cylindrical panorama that tracks the camera's yaw/pitch (and, via a render-then-rotate composite, roll), giving a Camera3d scene a sky/horizon background instead of a flat fill. See SceneObjectSkybox for the draw algorithm.

Properties

  • degreesPerFullWidth (float) — How many degrees of camera yaw the texture's full width covers. Default wraps a
  • verticalDegreesCovered (float) — How many degrees of camera pitch the texture's full height covers, centered on

Constructor

new DrawableSkybox( owner: BGE.GameEntity, region: roRegion, args?: object, ): DrawableSkybox

Parameters

  • owner (BGE.GameEntity)
  • region (roRegion) — a cylindrical panorama texture
  • args (object, optional, default: "{}") — pass degreesPerFullWidth/verticalDegreesCovered here to override the defaults

Instance Methods

addToRenderer(rendererObj: Renderer): void

Parameters

Returns

  • void

getPretranslation(): BGE.Math.Vector

Inherited from BGE.Image#getPretranslation

Returns

  • BGE.Math.Vector

setAnchor(x: float, y: float): void

Inherited from BGE.Image#setAnchor

Sets the normalized anchor point this drawable pivots around. (0,0) is top left (the default), (0.5, 1) is bottom-center, etc. This isn't movement, so it can't be picked up by the per-frame MotionChecker dirty-check - invalidateGeometry() tells the renderer to recompute this drawable's projected geometry even though nothing moved.

Parameters

  • x (float)
  • y (float)

Returns

  • void

applyAnchorToRegion(): void

protected

Inherited from BGE.Image#applyAnchorToRegion

Overrides: BGE.Image#applyAnchorToRegion

Returns

  • void

addToRenderer(rendererObj: Renderer): void

Inherited from BGE.DrawableSkybox#addToRenderer

Overrides: BGE.Image#addToRenderer

Registers this Drawable with a Renderer, so it gets drawn each frame. The engine calls this for you when a drawable is added to an entity; call it yourself only for a standalone drawable. Subclasses override it to create their SceneObject.

Parameters

Returns

  • void

getSceneObjects(): Array.<BGE.SceneObject>

Inherited from BGE.Drawable#getSceneObjects

Overrides: BGE.Image#getSceneObjects

Every SceneObject this Drawable currently represents - usually one (a Drawable added to just the game canvas), but can be more than one if the same Drawable instance was also added to a second renderer (e.g. the UI canvas). Useful for consumer code that needs to identify "my own" SceneObject out of a list the renderer hands back (e.g. Renderer.getOverlapClusters()) - comparing two custom class instances directly with = is not supported by BrightScript at runtime (a "Type Mismatch" error, regardless of any as-cast at the BrighterScript type- checker level, which only affects compile-time typing, not the underlying VM operator), so compare SceneObject.id (a string) instead.

Returns

removeFromRenderer(renderer: Renderer): void

Inherited from BGE.Drawable#removeFromRenderer

Overrides: BGE.Image#removeFromRenderer

Unregisters every SceneObject this Drawable added to the given Renderer, so it stops being drawn. The engine calls this for you when a drawable is removed from an entity or the entity is destroyed.

Parameters

  • renderer (Renderer) — The renderer to remove this Drawable from

Returns

  • void

computeTransformationMatrix(): void

Inherited from BGE.Drawable#computeTransformationMatrix

Overrides: BGE.Image#computeTransformationMatrix

Returns

  • void

hasPendingTransformChange(): boolean

Inherited from BGE.Drawable#hasPendingTransformChange

Overrides: BGE.Image#hasPendingTransformChange

Whether offset/rotation/scale changed since the transform was last computed. Read-only (doesn't touch the MotionChecker), so every renderer this drawable is registered with sees the same answer.

Returns

  • boolean

invalidateGeometry(): void

Inherited from BGE.Drawable#invalidateGeometry

Overrides: BGE.Image#invalidateGeometry

Marks this drawable's geometry as changed, so the renderer recomputes its world and canvas geometry on the next frame. Movement is dirty-checked automatically (see MotionChecker), but a change in shape - resizing a rectangle, replacing a polygon's points - isn't visible to that check and has to be declared.

Returns

  • void

getAnchor(): BGE.Math.Vector

Inherited from BGE.Drawable#getAnchor

Overrides: BGE.Image#getAnchor

Returns

  • BGE.Math.Vector

movedLastFrame(includeOwner?: boolean): boolean

Inherited from BGE.Drawable#movedLastFrame

Overrides: BGE.Image#movedLastFrame

Parameters

  • includeOwner (boolean, optional, default: false)

Returns

  • boolean

update(): void

Inherited from BGE.Drawable#update

Overrides: BGE.Image#update

Returns

  • void

onResume(pausedTimeMs: integer): void

Inherited from BGE.Drawable#onResume

Overrides: BGE.Image#onResume

Parameters

  • pausedTimeMs (integer)

Returns

  • void

isEnabled(): boolean

Inherited from BGE.Drawable#isEnabled

Overrides: BGE.Image#isEnabled

Returns

  • boolean

getGame(): BGE.Game

Inherited from BGE.Drawable#getGame

Overrides: BGE.Image#getGame

The Game this drawable's owner belongs to.

Returns

  • BGE.Game — the owner's Game, or invalid if this drawable has no owner (or its owner has no Game)

log(message: string, level?: BGE.Debug.LogLevel): void

Inherited from BGE.Drawable#log

Overrides: BGE.Image#log

Logs a message through the owner's Game. Does nothing if there is no Game to log to.

Parameters

  • message (string)
  • level (BGE.Debug.LogLevel, optional, default: "BGE.Debug.LogLevel.info")

Returns

  • void

getOwnerTransformationMatrix(): Array.<Array.<float>>

Inherited from BGE.Drawable#getOwnerTransformationMatrix

Overrides: BGE.Image#getOwnerTransformationMatrix

The owner's transformation matrix, or the identity matrix if this drawable has no owner.

Returns

  • Array.<Array.<float>>

getOwnerPosition(): BGE.Math.Vector

Inherited from BGE.Drawable#getOwnerPosition

Overrides: BGE.Image#getOwnerPosition

The owner's position, or the world origin if this drawable has no owner.

Returns

  • BGE.Math.Vector

getOwnerRotation(): BGE.Math.Vector

Inherited from BGE.Drawable#getOwnerRotation

Overrides: BGE.Image#getOwnerRotation

The owner's rotation, or no rotation if this drawable has no owner.

Returns

  • BGE.Math.Vector

getOwnerScale(): BGE.Math.Vector

Inherited from BGE.Drawable#getOwnerScale

Overrides: BGE.Image#getOwnerScale

The owner's scale, or a scale of 1 on every axis if this drawable has no owner.

Returns

  • BGE.Math.Vector

getSize(): SizeWH

Inherited from BGE.Drawable#getSize

Overrides: BGE.Image#getSize

Returns

getDrawnSize(): SizeWH

Inherited from BGE.Drawable#getDrawnSize

Overrides: BGE.Image#getDrawnSize

Returns

getWorldPosition(): BGE.Math.Vector

Inherited from BGE.Drawable#getWorldPosition

Overrides: BGE.Image#getWorldPosition

Returns

  • BGE.Math.Vector

getFillColorRGBA(ignoreColor?: boolean): integer

Inherited from BGE.Drawable#getFillColorRGBA

Overrides: BGE.Image#getFillColorRGBA

Parameters

  • ignoreColor (boolean, optional, default: false)

Returns

  • integer

getOutlineColorRGBA(ignoreColor?: boolean): integer

Inherited from BGE.Drawable#getOutlineColorRGBA

Overrides: BGE.Image#getOutlineColorRGBA

Parameters

  • ignoreColor (boolean, optional, default: false)

Returns

  • integer

hasOutline(): boolean

Inherited from BGE.Drawable#hasOutline

Overrides: BGE.Image#hasOutline

Whether this drawable should be stroked with an outline, which is the case once outlineRGBA has been given a color. Setting outlineRGBA is what turns outline drawing on - there is no separate flag - so this is the check the renderer uses to skip all outline work for the (common) drawables that don't want one.

Returns

  • boolean — true if an outline should be drawn for this drawable

getSceneObjectName(extraBit?: string): string

protected

Inherited from BGE.Drawable#getSceneObjectName

Overrides: BGE.Image#getSceneObjectName

Parameters

  • extraBit (string, optional, default: "\"\"")

Returns

  • string

addSceneObjectToRenderer( sceneObj: SceneObject, renderer: Renderer, ): SceneObject

protected

Inherited from BGE.Drawable#addSceneObjectToRenderer

Overrides: BGE.Image#addSceneObjectToRenderer

Parameters

Returns

drawRegionToCanvas( region: ifDraw2d, additionalRotation?: BGE.Math.Vector, ignoreColor?: boolean, drawTo?: ifDraw2D, ): void

protected

Inherited from BGE.Drawable#drawRegionToCanvas

Overrides: BGE.Image#drawRegionToCanvas

Parameters

  • region (ifDraw2d)
  • additionalRotation (BGE.Math.Vector, optional, default: "invalid")
  • ignoreColor (boolean, optional, default: false)
  • drawTo (ifDraw2D, optional, default: "invalid")

Returns

  • void

forEachSceneObject( operation: function, context: roAssociativeArray, ): void

Inherited from BGE.Drawable#forEachSceneObject

Overrides: BGE.Image#forEachSceneObject

Parameters

  • operation (function)
  • context (roAssociativeArray)

Returns

  • void

isOnScreen(): boolean

Inherited from BGE.Drawable#isOnScreen

Overrides: BGE.Image#isOnScreen

Whether this drawable was actually drawn (not culled) in at least one of the renderers it's registered with, as of the last frame. True before this has ever been added to a renderer (nothing to say it's off-screen yet), so game code can use this to skip expensive per-frame work for an off-screen entity without it defaulting to "invisible" before the first frame ever draws. See GameEntity.isOnScreen() and issue #75.

Returns

  • boolean

getPretranslation(): BGE.Math.Vector

Inherited from BGE.Image#getPretranslation

Returns

  • BGE.Math.Vector

setAnchor(x: float, y: float): void

Inherited from BGE.Image#setAnchor

Sets the normalized anchor point this drawable pivots around. (0,0) is top left (the default), (0.5, 1) is bottom-center, etc. This isn't movement, so it can't be picked up by the per-frame MotionChecker dirty-check - invalidateGeometry() tells the renderer to recompute this drawable's projected geometry even though nothing moved.

Parameters

  • x (float)
  • y (float)

Returns

  • void

addToRenderer(rendererObj: Renderer): void

Inherited from BGE.DrawableSkybox#addToRenderer

Overrides: BGE.Image#addToRenderer

Registers this Drawable with a Renderer, so it gets drawn each frame. The engine calls this for you when a drawable is added to an entity; call it yourself only for a standalone drawable. Subclasses override it to create their SceneObject.

Parameters

Returns

  • void