You.i Engine
YiScalingLayout.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_SCALING_LAYOUT_H_
3 #define _YI_SCALING_LAYOUT_H_
4 
5 #include "layout/YiStackLayout.h"
6 
42 {
43 public:
45  virtual ~CYIScalingLayout();
46 
50  enum class ScaleMode
51  {
52  None,
53  Stretch,
54  Fit,
55  Fill,
56  };
57 
61  void SetScalingMode(ScaleMode mode);
62  ScaleMode GetScalingMode() const;
63 
64 protected:
65  virtual void Configure() override;
66 
67  virtual void OnMeasure(const CYISceneNode::MeasureSpec &widthSpec, const CYISceneNode::MeasureSpec &heightSpec, const CYISceneNode::MeasureSpec &depthSpec) override;
68 
69  virtual void OnApplyMeasurements() override;
70 
74  virtual void ApplyScale(CYISceneNode *pChild, const glm::vec3 &scale);
75 
76 private:
77  ScaleMode m_scaleMode;
78 
80 };
81 
84 #endif // _YI_SCALING_LAYOUT_H_
virtual ~CYIScalingLayout()
ScaleMode
Definition: YiScalingLayout.h:50
virtual void OnMeasure(const CYISceneNode::MeasureSpec &widthSpec, const CYISceneNode::MeasureSpec &heightSpec, const CYISceneNode::MeasureSpec &depthSpec) override
virtual void OnApplyMeasurements() override
ScaleMode GetScalingMode() const
virtual void ApplyScale(CYISceneNode *pChild, const glm::vec3 &scale)
Causes the children to stretch to fill the container.
Causes the children to be given a scale of 1.0.
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:105
Definition: YiSceneNode.h:374
void SetScalingMode(ScaleMode mode)
A layout that scales its children to fill their container.
Definition: YiScalingLayout.h:41
Causes the children to proportionally scale to fill the container. The children may overflow out of t...
virtual void Configure() override
Causes the children to proportionally scale to fit the container. The aspect ratio of the children is...
A layout that positions all of its children in a 'stack'.
Definition: YiStackLayout.h:29
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:259