mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6789 from cocoscodeide/v3
update template project vect
This commit is contained in:
commit
95149a45e0
|
@ -41,56 +41,56 @@ Rect VisibleRect::getVisibleRect()
|
||||||
return s_visibleRect;
|
return s_visibleRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::left()
|
Vec2 VisibleRect::left()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height/2);
|
return Vec2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::right()
|
Vec2 VisibleRect::right()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height/2);
|
return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::top()
|
Vec2 VisibleRect::top()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height);
|
return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::bottom()
|
Vec2 VisibleRect::bottom()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y);
|
return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::center()
|
Vec2 VisibleRect::center()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height/2);
|
return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::leftTop()
|
Vec2 VisibleRect::leftTop()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height);
|
return Vec2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::rightTop()
|
Vec2 VisibleRect::rightTop()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height);
|
return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::leftBottom()
|
Vec2 VisibleRect::leftBottom()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return s_visibleRect.origin;
|
return s_visibleRect.origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 VisibleRect::rightBottom()
|
Vec2 VisibleRect::rightBottom()
|
||||||
{
|
{
|
||||||
lazyInit();
|
lazyInit();
|
||||||
return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y);
|
return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,15 @@ class VisibleRect
|
||||||
public:
|
public:
|
||||||
static cocos2d::Rect getVisibleRect();
|
static cocos2d::Rect getVisibleRect();
|
||||||
|
|
||||||
static cocos2d::Vector2 left();
|
static cocos2d::Vec2 left();
|
||||||
static cocos2d::Vector2 right();
|
static cocos2d::Vec2 right();
|
||||||
static cocos2d::Vector2 top();
|
static cocos2d::Vec2 top();
|
||||||
static cocos2d::Vector2 bottom();
|
static cocos2d::Vec2 bottom();
|
||||||
static cocos2d::Vector2 center();
|
static cocos2d::Vec2 center();
|
||||||
static cocos2d::Vector2 leftTop();
|
static cocos2d::Vec2 leftTop();
|
||||||
static cocos2d::Vector2 rightTop();
|
static cocos2d::Vec2 rightTop();
|
||||||
static cocos2d::Vector2 leftBottom();
|
static cocos2d::Vec2 leftBottom();
|
||||||
static cocos2d::Vector2 rightBottom();
|
static cocos2d::Vec2 rightBottom();
|
||||||
private:
|
private:
|
||||||
static void lazyInit();
|
static void lazyInit();
|
||||||
static cocos2d::Rect s_visibleRect;
|
static cocos2d::Rect s_visibleRect;
|
||||||
|
|
Loading…
Reference in New Issue