![]() |
Gorgon Game Engine
|
Pointer resource that can be used to create a new pointer to be displayed. More...
Public Member Functions | |
| Pointer (const Pointer &)=delete | |
| Pointer (Graphics::Bitmap &bmp, Geometry::Point hotspot, Graphics::PointerType type) | |
| Pointer (Graphics::BitmapAnimationProvider &&anim, Geometry::Point hotspot, Graphics::PointerType type) | |
| Pointer (Graphics::PointerType type=Graphics::PointerType::None) | |
| GID::Type | GetGID () const override |
| This function shall return Gorgon ID of this resource. More... | |
| Graphics::PointerType | GetType () const |
| Returns the type of the pointer. More... | |
| Graphics::BitmapPointerProvider | MoveOut () |
| Moves the pointer provider out of resource system. More... | |
| Pointer & | operator= (const Pointer &)=delete |
| void | Prepare () override |
| This function shall prepare this resource to be used after resource is loaded. More... | |
| void | SetType (Graphics::PointerType value) |
| Sets the type of the pointer. More... | |
Public Member Functions inherited from AnimationStorage | |
| Graphics::RectangularAnimationStorage | MoveOut () |
| Moves this animation out as a generic value type animation. More... | |
Public Member Functions inherited from Base | |
| Base () | |
| Default constructor. More... | |
| const Containers::Collection< Base >::ConstIterator | begin () const |
| Allows easy iteration through range based fors. More... | |
| const Containers::Collection< Base >::ConstIterator | cbegin () const |
| Beginning of children. More... | |
| const Containers::Collection< Base >::ConstIterator | cend () const |
| End of children. More... | |
| bool | DeleteResource () |
| Safely deletes the resource. More... | |
| virtual void | Discard () |
| This function shall discard any transitional data which is not vital after Prepare function is issued. More... | |
| const Containers::Collection< Base >::ConstIterator | end () const |
| Allows easy iteration through range based fors. More... | |
| virtual SGuid | GetGuid () const |
| Returns the guid of the object. More... | |
| const std::string & | GetName () const |
| Returns the name of this object. More... | |
| Base & | GetParent () const |
| Returns the parent. If no parent set, this function throws std::runtime_error. More... | |
| Base * | GetParentPtr () const |
| Returns the pointer to the parent. This function may return nullptr. More... | |
| const Base & | GetRoot () const |
| Returns the root of this resource. More... | |
| bool | HasParent () const |
| Returns whether this object has a parent. More... | |
| virtual bool | IsEqual (const SGuid &guid) const |
| This function tests whether this object has the given SGuid. More... | |
| virtual void | Resolve (File &file) |
| This function shall resolve links or similar constructs. More... | |
| void | Save (Writer &writer) |
| Saves this object into the given writer. The writer should be open prior to this call. More... | |
| virtual void | SetGuid (SGuid guid) |
| Changes the guid of the object. More... | |
| virtual void | SetName (const std::string &name) |
| Sets the name of the object. More... | |
Public Member Functions inherited from basic_PointerProvider< A_ > | |
| basic_PointerProvider (basic_PointerProvider &&other) | |
| Move constructor. More... | |
| basic_PointerProvider (const basic_PointerProvider &)=delete | |
| basic_PointerProvider (Geometry::Point hotspot={0, 0}) | |
| virtual | ~basic_PointerProvider () |
| AnimationType & | CreateAnimation (bool create=true) const override |
| Creates a pointer from this provider. More... | |
| AnimationType & | CreateAnimation (Gorgon::Animation::ControllerBase &timer) const override |
| Creates a pointer from this provider. More... | |
| AnimationType | CreatePointer (bool create=true) const |
| Creates a pointer from this provider, just a rename for CreateAnimation. More... | |
| AnimationType | CreatePointer (Gorgon::Animation::Timer &timer) const |
| Creates a pointer from this provider. More... | |
| Geometry::Point | GetHotspot () const |
| Returns the hotspot of the provider. More... | |
| void | SetHotspot (Geometry::Point value) |
| Sets the hotspot of the pointer. More... | |
Static Public Member Functions | |
| static Pointer * | LoadLegacy (std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size) |
| This function loads a bitmap font resource from the given file. More... | |
| static Resource::Pointer * | LoadResource (std::weak_ptr< Gorgon::Resource::File > file, std::shared_ptr< Gorgon::Resource::Reader > reader, long unsigned int size) |
| This function loads a bitmap font resource from the given file. More... | |
Protected Member Functions | |
| virtual | ~Pointer () |
| virtual Graphics::RectangularAnimationStorage | animmoveout () override |
| void | save (Writer &writer) const override |
Protected Member Functions inherited from Base | |
| virtual | ~Base () |
| Destructor, Always children gets destroyed first. More... | |
| void | destroychildren () |
| Destroys the children of this resource. More... | |
| void | setparenttonullptr (Base &base) |
| Sets the parent of an object to nullptr, provides access. More... | |
Protected Attributes | |
| Graphics::PointerType | type |
Protected Attributes inherited from Base | |
| Containers::Collection< Base > | children |
| Child objects that this resource object have. More... | |
| SGuid | guid |
| SGuid to identify this resource object. More... | |
| std::string | name |
| Name of this resource object, may not be loaded. More... | |
| Base * | parent |
| Immediate parent of this resource. More... | |
| const Base * | root |
| Root of this resource. More... | |
Protected Attributes inherited from basic_PointerProvider< A_ > | |
| Geometry::Point | hotspot |
| Hotspot will be transferred to newly created pointers. More... | |
| bool | owned |
| Whether the animation is owned by this object. More... | |
Additional Inherited Members | |
Public Types inherited from basic_PointerProvider< A_ > | |
| using | AnimationType = basic_AnimatedPointer< A_ > |
Public Attributes inherited from Base | |
| const Containers::Collection< Base > & | Children |
| The children this object have. More... | |
| unsigned long | refcount |
| INTERNAL, Reference count, used in linking mechanism. More... | |
Pointer resource that can be used to create a new pointer to be displayed.
A Pointer resource can be created from a bitmap or an animation.
| Pointer | ( | Graphics::Bitmap & | bmp, |
| Geometry::Point | hotspot, | ||
| Graphics::PointerType | type | ||
| ) |
| Pointer | ( | Graphics::BitmapAnimationProvider && | anim, |
| Geometry::Point | hotspot, | ||
| Graphics::PointerType | type | ||
| ) |
|
explicit |
|
protectedvirtual |
|
overrideprotectedvirtual |
Implements AnimationStorage.
|
overridevirtual |
This function shall return Gorgon ID of this resource.
Implements Base.
References Gorgon::Resource::GID::Pointer.
| Graphics::PointerType GetType | ( | ) | const |
Returns the type of the pointer.
References Pointer::type.
|
static |
This function loads a bitmap font resource from the given file.
References Gorgon::Utils::NotImplemented().
|
static |
This function loads a bitmap font resource from the given file.
References Pointer::Pointer(), Gorgon::Resource::GID::Animation, ASSERT, Gorgon::Utils::ASSERT_FALSE(), Base::children, Reader::EatChunk(), Gorgon::String::From(), basic_PointerProvider< A_ >::hotspot, Animation::LoadResource(), Gorgon::Resource::GID::Pointer_Props, Reader::ReadChunkSize(), Reader::ReadCommonChunk(), Reader::ReadEnum32(), Reader::ReadGID(), Reader::ReadPoint(), Reader::Target(), and Pointer::type.
| Graphics::BitmapPointerProvider MoveOut | ( | ) |
Moves the pointer provider out of resource system.
Use Prepare and Discard before calling this function to avoid data duplication
|
overridevirtual |
This function shall prepare this resource to be used after resource is loaded.
Default behavior is to pass the request to children
Reimplemented from Base.
|
overrideprotectedvirtual |
| void SetType | ( | Graphics::PointerType | value | ) |
Sets the type of the pointer.
References Pointer::type.
|
protected |