Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CGUIMouseEventMask Class Reference

A custom shape that changes the object's "over-ability", and thus where one can click on it. More...

#include <MouseEventMask.h>

Inheritance diagram for CGUIMouseEventMask:
Collaboration diagram for CGUIMouseEventMask:

Classes

class  Impl
 

Public Member Functions

 NONCOPYABLE (CGUIMouseEventMask)
 
 CGUIMouseEventMask (IGUIObject *owner)
 
 CGUIMouseEventMask (CGUIMouseEventMask &&)=default
 
CGUIMouseEventMaskoperator= (CGUIMouseEventMask &&)=delete
 
 ~CGUIMouseEventMask ()
 
 operator bool () const
 
bool IsMouseOver (const CVector2D &mousePos, const CRect &objectSize) const
 
void ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue value) override
 Converts the setting data to a JS::Value using Script::ToJSVal. More...
 
- Public Member Functions inherited from IGUISetting
 NONCOPYABLE (IGUISetting)
 
 IGUISetting (const CStr &name, IGUIObject *owner)
 
bool FromString (const CStrW &value, const bool sendMessage)
 Parses the given string and assigns to the setting value. More...
 
bool FromJSVal (const ScriptRequest &rq, JS::HandleValue value, const bool sendMessage)
 Parses the given JS::Value using Script::FromJSVal and assigns it to the setting data. More...
 
virtual void ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue value)=0
 Converts the setting data to a JS::Value using Script::ToJSVal. More...
 

Protected Member Functions

bool DoFromString (const CStrW &value) override
 
bool DoFromJSVal (const ScriptRequest &rq, JS::HandleValue value) override
 
- Protected Member Functions inherited from IGUISetting
 IGUISetting (IGUISetting &&other)
 
IGUISettingoperator= (IGUISetting &&other)=delete
 
virtual ~IGUISetting ()=default
 
virtual bool DoFromString (const CStrW &value)=0
 
virtual bool DoFromJSVal (const ScriptRequest &rq, JS::HandleValue value)=0
 
virtual void OnSettingChange (const CStr &setting, bool sendMessage)
 Triggers the IGUIObject logic when a setting changes. More...
 
const CStr & GetName () const
 Return the name of the setting, from JS. More...
 

Protected Attributes

std::string m_Spec
 
std::unique_ptr< Implm_Impl
 
- Protected Attributes inherited from IGUISetting
IGUIObjectm_Object
 The object that stores this setting. More...
 

Detailed Description

A custom shape that changes the object's "over-ability", and thus where one can click on it.

Supported:

  • "texture:[path]" loads a texture and uses either the alpha or the red channel. Any non-0 is clickable. The texture is always 'stretched' in sprite terminology.

TODO:

  • the minimap circular shape should be moved here.

Constructor & Destructor Documentation

◆ CGUIMouseEventMask() [1/2]

CGUIMouseEventMask::CGUIMouseEventMask ( IGUIObject owner)

◆ CGUIMouseEventMask() [2/2]

CGUIMouseEventMask::CGUIMouseEventMask ( CGUIMouseEventMask &&  )
default

◆ ~CGUIMouseEventMask()

CGUIMouseEventMask::~CGUIMouseEventMask ( )

Member Function Documentation

◆ DoFromJSVal()

bool CGUIMouseEventMask::DoFromJSVal ( const ScriptRequest rq,
JS::HandleValue  value 
)
overrideprotectedvirtual

Implements IGUISetting.

◆ DoFromString()

bool CGUIMouseEventMask::DoFromString ( const CStrW &  value)
overrideprotectedvirtual

Implements IGUISetting.

◆ IsMouseOver()

bool CGUIMouseEventMask::IsMouseOver ( const CVector2D mousePos,
const CRect objectSize 
) const
Returns
true if the mouse pointer is over the mask. False if the mask is not initialised.

◆ NONCOPYABLE()

CGUIMouseEventMask::NONCOPYABLE ( CGUIMouseEventMask  )

◆ operator bool()

CGUIMouseEventMask::operator bool ( ) const
inlineexplicit
Returns
true if the mask is initialised <=> its spec is not ""

◆ operator=()

CGUIMouseEventMask & CGUIMouseEventMask::operator= ( CGUIMouseEventMask &&  )
delete

◆ ToJSVal()

void CGUIMouseEventMask::ToJSVal ( const ScriptRequest rq,
JS::MutableHandleValue  value 
)
overridevirtual

Converts the setting data to a JS::Value using Script::ToJSVal.

Implements IGUISetting.

Member Data Documentation

◆ m_Impl

std::unique_ptr<Impl> CGUIMouseEventMask::m_Impl
protected

◆ m_Spec

std::string CGUIMouseEventMask::m_Spec
protected

The documentation for this class was generated from the following files: