v_sim.GlExtBg

g GObject.Object GObject.Object v_sim.GlExt v_sim.GlExt GObject.Object->v_sim.GlExt v_sim.GlExtBg v_sim.GlExtBg v_sim.GlExt->v_sim.GlExtBg

Subclasses:

None

Methods

Inherited:

v_sim.GlExt (16), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (name)

setCamera (zoom, xs, ys)

setFile (path)

setFollowCamera (follow, zoomInit, xs, ys)

setImage (imageData, width, height, alpha, title, fit)

Virtual Methods

Inherited:

v_sim.GlExt (3), GObject.Object (7)

Properties

Inherited:

v_sim.GlExt (9)

Name

Type

Flags

Short Description

background-file

str

r/w

path to the background image.

display-background-filename

bool

r/w

display or not the background filename.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

v_sim.GlExt

r

priv

v_sim.GlExtBgPrivate

r

Class Details

class v_sim.GlExtBg(**kwargs)
Bases:

v_sim.GlExt

Abstract:

No

Structure:

v_sim.GlExtBgClass

An opaque structure.

New in version 3.7.

classmethod new(name)
Parameters:

name (str or None) – the name to give to the extension (default is v_sim.GL_EXT_BG_ID).

Returns:

a pointer to the v_sim.GlExt it created or None otherwise.

Return type:

v_sim.GlExtBg

Creates a new v_sim.GlExt to draw bg.

New in version 3.7.

setCamera(zoom, xs, ys)
Parameters:
  • zoom (float) – a floating point value.

  • xs (float) – a floating point value.

  • ys (float) – a floating point value.

Returns:

True if the settings are indeed changed.

Return type:

bool

If the background image is in follow mode, see v_sim.GlExtBg.setFollowCamera(), this routine is used to update the current camera settings of the background image.

New in version 3.7.

setFile(path)
Parameters:

path (str) – a file path

Raises:

GLib.Error

Returns:

False if an error occured.

Return type:

bool

Loads path and store it as a background image for the scene, see v_sim.GlExtBg.setImage().

New in version 3.8.

setFollowCamera(follow, zoomInit, xs, ys)
Parameters:
  • follow (bool) – a boolean.

  • zoomInit (float) – a floating point value.

  • xs (float) – a floating point value.

  • ys (float) – a floating point value.

Returns:

True if the following status has been changed.

Return type:

bool

When follow is True, the size and the position of the background image is adjusted with every camera change.

New in version 3.7.

setImage(imageData, width, height, alpha, title, fit)
Parameters:
  • imageData (int or None) – raw image data in RGB or RGBA format ;

  • width (int) – the width ;

  • height (int) – the height ;

  • alpha (bool) – True if the image is RGBA ;

  • title (str or None) – an optional title (can be None).

  • fit (bool) – a boolean (default is True).

Draw the imageData on the background. The image is scaled to the viewport dimensions, keeping the width/height ratio, if fit is set to True. If title is not None, the title is also printed on the background. The image data are copied and can be free after this call.

Property Details

v_sim.GlExtBg.props.background_file
Name:

background-file

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

path to the background image.

v_sim.GlExtBg.props.display_background_filename
Name:

display-background-filename

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

display or not the background filename.