axmol/extensions/DragonBones/armature/Slot.h

508 lines
15 KiB
C
Raw Normal View History

/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef DRAGONBONES_SLOT_H
#define DRAGONBONES_SLOT_H
#include "TransformObject.h"
#include "../geom/ColorTransform.h"
#include "../model/ArmatureData.h"
DRAGONBONES_NAMESPACE_BEGIN
/**
* - The slot attached to the armature, controls the display status and properties of the display object.
* A bone can contain multiple slots.
* A slot can contain multiple display objects, displaying only one of the display objects at a time,
* but you can toggle the display object into frame animation while the animation is playing.
* The display object can be a normal texture, or it can be a display of a child armature, a grid display object,
* and a custom other display object.
* @see dragonBones.Armature
* @see dragonBones.Bone
* @see dragonBones.SlotData
* @version DragonBones 3.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD>۸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԡ<EFBFBD>
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><EFBFBD>԰<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۡ<EFBFBD>
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><EFBFBD>԰<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһʱ<EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>󣬵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵĹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>֡<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>ͼƬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹǼܵ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>󣬻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @see dragonBones.Armature
* @see dragonBones.Bone
* @see dragonBones.SlotData
* @version DragonBones 3.0
* @language zh_CN
*/
class Slot : public TransformObject
{
public:
/**
* - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states.
* @default null
* @see dragonBones.AnimationState#displayControl
* @see dragonBones.AnimationState#name
* @see dragonBones.AnimationState#group
* @version DragonBones 4.5
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƵĶ<EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ null <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>
* @default null
* @see dragonBones.AnimationState#displayControl
* @see dragonBones.AnimationState#name
* @see dragonBones.AnimationState#group
* @version DragonBones 4.5
* @language zh_CN
*/
std::string displayController;
public:
/**
* @internal
*/
bool _colorDirty;
BlendMode _blendMode;
/**
* @internal
*/
int _zOrder;
/**
* @internal
*/
float _pivotX;
/**
* @internal
*/
float _pivotY;
/**
* @internal
*/
ColorTransform _colorTransform;
/**
* @internal
*/
const SlotData* _slotData;
/**
* @internal
*/
DisplayData* _displayData;
/**
* @internal
*/
DeformVertices* _deformVertices;
void* _rawDisplay;
void* _meshDisplay;
/**
* @internal
*/
std::vector<int>* _cachedFrameIndices;
protected:
bool _displayDirty;
bool _zOrderDirty;
bool _visibleDirty;
bool _blendModeDirty;
bool _transformDirty;
bool _visible;
int _displayIndex;
int _animationDisplayIndex;
int _cachedFrameIndex;
Matrix _localMatrix;
std::vector<DisplayData*> _displayDatas;
std::vector<std::pair<void*, DisplayType>> _displayList;
const std::vector<DisplayData*>* _rawDisplayDatas;
BoundingBoxData* _boundingBoxData;
TextureData* _textureData;
void* _display;
Armature* _childArmature;
/**
* @private
*/
Bone* _parent;
public:
Slot() :
_deformVertices(nullptr),
_rawDisplay(nullptr),
_meshDisplay(nullptr)
{}
virtual ~Slot() {};
protected:
virtual void _onClear() override;
virtual void _initDisplay(void* value, bool isRetain) = 0;
virtual void _disposeDisplay(void* value, bool isRelease) = 0;
virtual void _onUpdateDisplay() = 0;
virtual void _addDisplay() = 0;
virtual void _replaceDisplay(void* value, bool isArmatureDisplay) = 0;
virtual void _removeDisplay() = 0;
virtual void _updateZOrder() = 0;
virtual void _updateFrame() = 0;
virtual void _updateMesh() = 0;
virtual void _updateTransform() = 0;
virtual void _identityTransform() = 0;
/**
* - Support default skin data.
*/
DisplayData* _getDefaultRawDisplayData(unsigned displayIndex) const;
void _updateDisplay();
void _updateDisplayData();
void _updateGlobalTransformMatrix(bool isCache);
public:
/**
* @internal
*/
virtual void _updateVisible() = 0;
virtual void _updateBlendMode() = 0;
virtual void _updateColor() = 0;
public:
/**
* @internal
*/
bool _setDisplayIndex(int value, bool isAnimation = false);
/**
* @internal
*/
bool _setZorder(int value);
/**
* @internal
*/
bool _setColor(const ColorTransform& value);
/**
* @internal
*/
bool _setDisplayList(const std::vector<std::pair<void*, DisplayType>>& value);
public:
/**
* @internal
*/
void init(const SlotData* slotData, Armature* armatureValue, void* rawDisplay, void* meshDisplay);
/**
* @internal
*/
void update(int cacheFrameIndex);
/**
* @private
*/
void updateTransformAndMatrix();
/**
* @private
*/
void replaceDisplayData(DisplayData* displayData, int displayIndex);
/**
* - Check whether a specific point is inside a custom bounding box in the slot.
* The coordinate system of the point is the inner coordinate system of the armature.
* Custom bounding boxes need to be customized in Dragonbones Pro.
* @param x - The horizontal coordinate of the point.
* @param y - The vertical coordinate of the point.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD>۵<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڡ<EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵΪ<EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD>
* <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD> DragonBones Pro <EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD>
* @param x - <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮƽ<EFBFBD><EFBFBD><EFBFBD>
* @param y - <EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>
* @version DragonBones 5.0
* @language zh_CN
*/
bool containsPoint(float x, float y);
/**
* - Check whether a specific segment intersects a custom bounding box for the slot.
* The coordinate system of the segment and intersection is the inner coordinate system of the armature.
* Custom bounding boxes need to be customized in Dragonbones Pro.
* @param xA - The horizontal coordinate of the beginning of the segment.
* @param yA - The vertical coordinate of the beginning of the segment.
* @param xB - The horizontal coordinate of the end point of the segment.
* @param yB - The vertical coordinate of the end point of the segment.
* @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated)
* @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated)
* @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated)
* @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections]
* @version DragonBones 5.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>߶<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۵<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD>߶κͽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD>Ϊ<EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD>
* <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD> DragonBones Pro <EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD>
* @param xA - <EFBFBD>߶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮƽ<EFBFBD><EFBFBD><EFBFBD>
* @param yA - <EFBFBD>߶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>
* @param xB - <EFBFBD>߶<EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD>ˮƽ<EFBFBD><EFBFBD><EFBFBD>
* @param yB - <EFBFBD>߶<EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD>Ĵ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>
* @param intersectionPointA - <EFBFBD>߶δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD>򲻼<EFBFBD><EFBFBD><EFBFBD>
* @param intersectionPointB - <EFBFBD>߶δ<EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD>򲻼<EFBFBD><EFBFBD><EFBFBD>
* @param normalRadians - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵķ<EFBFBD><EFBFBD>߻<EFBFBD><EFBFBD>ȡ<EFBFBD> [x: <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵķ<EFBFBD><EFBFBD>߻<EFBFBD><EFBFBD><EFBFBD>, y: <EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵķ<EFBFBD><EFBFBD>߻<EFBFBD><EFBFBD><EFBFBD>] <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD>򲻼<EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD>
* @returns <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [-1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD><EFBFBD>ڰ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 0: <EFBFBD><EFBFBD><EFBFBD>, 1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD>ڰ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 2: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڰ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 3: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, N: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> N <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]
* @version DragonBones 5.0
* @language zh_CN
*/
int intersectsSegment(
float xA, float yA, float xB, float yB,
Point* intersectionPointA = nullptr,
Point* intersectionPointB = nullptr,
Point* normalRadians = nullptr
);
/**
* - Forces the slot to update the state of the display object in the next frame.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - ǿ<EFBFBD>Ʋ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ֡<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>
* @version DragonBones 4.5
* @language zh_CN
*/
inline void invalidUpdate()
{
_displayDirty = true;
_transformDirty = true;
}
/**
* - The visible of slot's display object.
* @default true
* @version DragonBones 5.6
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD>۵<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀɼ<EFBFBD><EFBFBD><EFBFBD>
* @default true
* @version DragonBones 5.6
* @language zh_CN
*/
inline bool getVisible() const
{
return _visible;
}
void setVisible(bool value);
/**
* - The index of the display object displayed in the display list.
* @example
* TypeScript style, for reference only.
* <pre>
* let slot = armature.getSlot("weapon");
* slot.displayIndex = 3;
* slot.displayController = "none";
* </pre>
* @version DragonBones 4.5
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>б<EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @example
* TypeScript <EFBFBD><EFBFBD><EFBFBD>񣬽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD>
* <pre>
* let slot = armature.getSlot("weapon");
* slot.displayIndex = 3;
* slot.displayController = "none";
* </pre>
* @version DragonBones 4.5
* @language zh_CN
*/
inline int getDisplayIndex() const
{
return _displayIndex;
}
void setDisplayIndex(int value);
/**
* - The slot name.
* @see dragonBones.SlotData#name
* @version DragonBones 3.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>
* @see dragonBones.SlotData#name
* @version DragonBones 3.0
* @language zh_CN
*/
inline const std::string& getName() const
{
return _slotData->name;
}
/**
* - Contains a display list of display objects or child armatures.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹǼܵ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>
* @version DragonBones 3.0
* @language zh_CN
*/
inline std::vector<std::pair<void*, DisplayType>> getDisplayList() const
{
return _displayList;
}
void setDisplayList(const std::vector<std::pair<void*, DisplayType>>& value);
/**
* @private
*/
inline const std::vector<DisplayData*>* getRawDisplayDatas() const
{
return _rawDisplayDatas;
}
void setRawDisplayDatas(const std::vector<DisplayData*>* value);
/**
* - The slot data.
* @see dragonBones.SlotData
* @version DragonBones 4.5
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>
* @see dragonBones.SlotData
* @version DragonBones 4.5
* @language zh_CN
*/
const SlotData* getSlotData() const
{
return _slotData;
}
/**
* - The custom bounding box data for the slot at current time.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD>۴<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>
* @version DragonBones 5.0
* @language zh_CN
*/
inline BoundingBoxData* getBoundingBoxData() const
{
return _boundingBoxData;
}
/**
* @private
*/
inline void* getRawDisplay() const
{
return _rawDisplay;
}
/**
* @private
*/
inline void* getMeshDisplay() const
{
return _meshDisplay;
}
/**
* - The display object that the slot displays at this time.
* @example
* TypeScript style, for reference only.
* <pre>
* let slot = armature.getSlot("text");
* slot.display = new yourEngine.TextField();
* </pre>
* @version DragonBones 3.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD>۴<EFBFBD>ʱ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @example
* TypeScript <EFBFBD><EFBFBD><EFBFBD>񣬽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD>
* <pre>
* let slot = armature.getSlot("text");
* slot.display = new yourEngine.TextField();
* </pre>
* @version DragonBones 3.0
* @language zh_CN
*/
inline void* getDisplay() const
{
return _display;
}
/**
* - Deprecated, please refer to {@link #display}.
* @deprecated
* @language en_US
*/
/**
* - <EFBFBD>ѷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> {@link #display}<EFBFBD><EFBFBD>
* @deprecated
* @language zh_CN
*/
void setDisplay(void* value, DisplayType displayType);
/**
* - The child armature that the slot displayed at current time.
* @example
* TypeScript style, for reference only.
* <pre>
* let slot = armature.getSlot("weapon");
* let prevChildArmature = slot.childArmature;
* if (prevChildArmature) {
* prevChildArmature.dispose();
* }
* slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
* </pre>
* @version DragonBones 3.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD>۴<EFBFBD>ʱ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>ӹǼܡ<EFBFBD>
* ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹǼܲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @example
* TypeScript <EFBFBD><EFBFBD><EFBFBD>񣬽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD>
* <pre>
* let slot = armature.getSlot("weapon");
* let prevChildArmature = slot.childArmature;
* if (prevChildArmature) {
* prevChildArmature.dispose();
* }
* slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
* </pre>
* @version DragonBones 3.0
* @language zh_CN
*/
inline Armature* getChildArmature() const
{
return _childArmature;
}
void setChildArmature(Armature* value);
/**
* - The parent bone to which it belongs.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @version DragonBones 3.0
* @language zh_CN
*/
inline Bone* getParent() const
{
return _parent;
}
};
DRAGONBONES_NAMESPACE_END
#endif // DRAGONBONES_SLOT_H