Example #1
0
TextureRegion* TextureRegion::create(const std::string& filename, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize)
{
    TextureRegion *TextureRegion = new (std::nothrow) TextureRegion();
    TextureRegion->initWithTextureFilename(filename, rect, rotated, offset, originalSize);
    TextureRegion->autorelease();

    return TextureRegion;
}
Example #2
0
TextureRegion* TextureRegion::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize)
{
    TextureRegion *TextureRegion = new (std::nothrow) TextureRegion();
    TextureRegion->initWithTexture(texture, rect, rotated, offset, originalSize);
    TextureRegion->autorelease();

    return TextureRegion;
}
Example #3
0
TextureRegion* TextureRegion::createWithTexture(Texture2D *texture, const Rect& rect)
{
    TextureRegion *TextureRegion = new (std::nothrow) TextureRegion();
    TextureRegion->initWithTexture(texture, rect);
    TextureRegion->autorelease();
    
    return TextureRegion;
}
Example #4
0
TextureRegion* TextureRegion::clone() const
{
	// no copy constructor	
    TextureRegion *copy = new (std::nothrow) TextureRegion();
    copy->initWithTextureFilename(_textureFilename.c_str(), _rectInPixels, _rotated, _offsetInPixels, _originalSizeInPixels);
    copy->setTexture(_texture);
    copy->autorelease();
    return copy;
}
Example #5
0
FLAKOR_NS_BEGIN

// implementation of TextureRegion

TextureRegion* TextureRegion::create(const std::string& filename, const Rect& rect)
{
    TextureRegion *TextureRegion = new (std::nothrow) TextureRegion();
    TextureRegion->initWithTextureFilename(filename, rect);
    TextureRegion->autorelease();

    return TextureRegion;
}