nux-1.14.0
nux::TextureArea Class Reference
Inheritance diagram for nux::TextureArea:
nux::View nux::InputArea nux::Area nux::InitiallyUnownedObject nux::Focusable nux::Object nux::Trackable nux::Introspectable Tile

List of all members.

Public Member Functions

 TextureArea (NUX_FILE_LINE_PROTO)
void SetTexture (BaseTexture *texture)
void SetPaintLayer (AbstractPaintLayer *layer)
void Set2DRotation (float angle)
 Convenience function to set a 2D rotation when rendering the area.
Matrix4 Get2DRotation () const

Public Attributes

sigc::signal< void, int, int > sigMouseDown
 Signal emmitted when a mouse button is pressed over this area.
sigc::signal< void, int, int > sigMouseDrag
 Signal emmitted when the mouse is dragged over this area.

Protected Member Functions

virtual void Draw (GraphicsEngine &GfxContext, bool force_draw)
virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw)
virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw)
void RecvMouseDown (int x, int y, long button_flags, long key_flags)
void RecvMouseUp (int x, int y, long button_flags, long key_flags)
void RecvMouseEnter (int x, int y, long button_flags, long key_flags)
void RecvMouseLeave (int x, int y, long button_flags, long key_flags)
void RecvMouseClick (int x, int y, long button_flags, long key_flags)
void RecvMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)

Detailed Description

Definition at line 29 of file TextureArea.h.


Member Function Documentation

void nux::TextureArea::Set2DRotation ( float  angle)

Convenience function to set a 2D rotation when rendering the area.

The rotation is only used for rendering. It should not be used for something else.

Definition at line 145 of file TextureArea.cpp.

References nux::View::QueueDraw().

  {
    _2d_rotate.Rotate_z (angle);
    QueueDraw ();
  }
void nux::TextureArea::SetPaintLayer ( AbstractPaintLayer layer)

Set the paint layer of this area. The layer argument to this function is cloned by this object. It layer was allocated on the heap, it must be deleted later.

Parameters:
layerA pointer to a concrete class that inherit from AbstractPaintLayer.

Definition at line 99 of file TextureArea.cpp.

References nux::View::QueueDraw().

  {
    NUX_SAFE_DELETE (m_PaintLayer);
    m_PaintLayer = layer->Clone();

    QueueDraw();
  }
void nux::TextureArea::SetTexture ( BaseTexture texture)

Render this area with a Texture. The reference count of the device texture which is cached by texture is increased by 1. It layer was allocated on the heap, it must be deleted later.

Parameters:
layerA pointer to a BaseTexture class.

Definition at line 86 of file TextureArea.cpp.

References nux::TexCoordXForm::OFFSET_COORD, and nux::View::QueueDraw().

  {
    NUX_RETURN_IF_NULL(texture);
    NUX_SAFE_DELETE(m_PaintLayer);

    TexCoordXForm texxform;
    texxform.SetTexCoordType(TexCoordXForm::OFFSET_COORD);
    texxform.SetWrap(TEXWRAP_REPEAT, TEXWRAP_REPEAT);
    m_PaintLayer = new TextureLayer(texture->GetDeviceTexture(), texxform, color::White);

    QueueDraw();
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends