summaryrefslogtreecommitdiff
path: root/DefaultContent/Libraries/Framework/Core/Sprite.lua
blob: 47cb50d476766bb78e7946f81aba88c64764d7e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- 对Quad的封装,更能适合2D游戏开发
local Sprite = {} 

Sprite.New = function(quad) 
    local spr = {} 
    spr.quad = Jin.Quad.New(quad) 
    spr.pivot = Jin.Vector2.New(0.5, 0)
    spr.transform = Jin.Transform.New()
    spr.depth = 0
    return spr
end

Sprite.SetDepth = function(self, depth)
    spr.depth = depth
end

Sprite.SetTexture = function(self, tex, reset_quad) 
    
end 

Jin.Sprite = Sprite