diff options
Diffstat (limited to 'Source/Asura.Framework/graphics')
-rw-r--r-- | Source/Asura.Framework/graphics/animator.lua | 8 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/image.lua | 2 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/mesh2d_renderer.lua | 4 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/particle_system.lua | 20 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/shader.lua | 5 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/shape.lua | 12 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/shape_renderer.lua | 13 | ||||
-rw-r--r-- | Source/Asura.Framework/graphics/sprite_renderer.lua | 2 |
8 files changed, 55 insertions, 11 deletions
diff --git a/Source/Asura.Framework/graphics/animator.lua b/Source/Asura.Framework/graphics/animator.lua index 8c8a185..98baf0d 100644 --- a/Source/Asura.Framework/graphics/animator.lua +++ b/Source/Asura.Framework/graphics/animator.lua @@ -2,9 +2,9 @@ AsuraEngine.Animator = AsuraEngine.Component.Sub("Animator") local Animator = AsuraEngine.Animator -function Animator:Ctor(go, animation) - self.base(go) - self.spriteRenderer = go:GetSpriteRenderer() +function Animator:Ctor(entity, animation) + self.base(entity) + self.spriteRenderer = entity:GetSpriteRenderer() self.animation = animation end @@ -23,3 +23,5 @@ end function Animator:OnRender() end + +return Animator
\ No newline at end of file diff --git a/Source/Asura.Framework/graphics/image.lua b/Source/Asura.Framework/graphics/image.lua index ad2e1a9..be55dbd 100644 --- a/Source/Asura.Framework/graphics/image.lua +++ b/Source/Asura.Framework/graphics/image.lua @@ -34,4 +34,4 @@ end --image不可再编辑器编辑,所以没有ToAsset方法 --function Image.ToAsset() ---end +--end
\ No newline at end of file diff --git a/Source/Asura.Framework/graphics/mesh2d_renderer.lua b/Source/Asura.Framework/graphics/mesh2d_renderer.lua index 01f0d90..debfd37 100644 --- a/Source/Asura.Framework/graphics/mesh2d_renderer.lua +++ b/Source/Asura.Framework/graphics/mesh2d_renderer.lua @@ -1,5 +1,5 @@ -local Mesh2DRenderer = Class() - +local Mesh2DRenderer = AsuraEngine.Component.Sub("Mesh2DRenderer") +AsuraEngine.Mesh2DRenderer = Mesh2DRenderer return Mesh2DRenderer
\ No newline at end of file diff --git a/Source/Asura.Framework/graphics/particle_system.lua b/Source/Asura.Framework/graphics/particle_system.lua index a5f8015..17d52e7 100644 --- a/Source/Asura.Framework/graphics/particle_system.lua +++ b/Source/Asura.Framework/graphics/particle_system.lua @@ -1,6 +1,20 @@ -local ParticleSystem = AsuraEngine.Component.Sub("ParticleSystem") -AsuraEngine.ParticleSystem = ParticleSystem +require "graphics.sprite_renderer" -function ParticleSystem.Ctor(self) +AsuraEngine.ParticleSystem = AsuraEngine.Component.Sub("ParticleSystem") + +local ParticleSystem = AsuraEngine.ParticleSystem + +function ParticleSystem.Ctor(self, entity, def) + self.base(entity) + self.spriteRenderer = AsuraEngine.SpriteRenderer.New() +end + +function ParticleSystem.OnRenderer() end + +function ParticleSystem.OnUpdate(dt) + +end + +return ParticleSystem
\ No newline at end of file diff --git a/Source/Asura.Framework/graphics/shader.lua b/Source/Asura.Framework/graphics/shader.lua index d381575..b719d2b 100644 --- a/Source/Asura.Framework/graphics/shader.lua +++ b/Source/Asura.Framework/graphics/shader.lua @@ -1,5 +1,6 @@ -local Shader = AsuraEngine.Asset.Sub("Shader") -AsuraEngine.Shader = Shader +AsuraEngine.Shader = AsuraEngine.Asset.Sub("Shader") + +local Shader = AsuraEngine.Shader function Shader.Ctor(self, vert, frag) local simShader = AsuraEngine.simShader(vert, frag) diff --git a/Source/Asura.Framework/graphics/shape.lua b/Source/Asura.Framework/graphics/shape.lua index e69de29..6d737f0 100644 --- a/Source/Asura.Framework/graphics/shape.lua +++ b/Source/Asura.Framework/graphics/shape.lua @@ -0,0 +1,12 @@ +-- +-- 2D图形 +-- +AsuraEngine.Shape = AsuraEngine.Asset.Sub("Shape") + +local Shape = AsuraEngine.Shape + +function Shape.Ctor(self) + +end + +return Shape
\ No newline at end of file diff --git a/Source/Asura.Framework/graphics/shape_renderer.lua b/Source/Asura.Framework/graphics/shape_renderer.lua index e69de29..8c002a2 100644 --- a/Source/Asura.Framework/graphics/shape_renderer.lua +++ b/Source/Asura.Framework/graphics/shape_renderer.lua @@ -0,0 +1,13 @@ +AsuraEngine.ShapeRenderer = AsuraEngine.Component.Sub("ShapeRenderer") + +local ShapeRenderer = AsuraEngine.ShapeRenderer + +function ShapeRenderer.OnRenderer() + +end + +function ShapeRenderer.OnUpdate(dt) + +end + +return ShapeRenderer
\ No newline at end of file diff --git a/Source/Asura.Framework/graphics/sprite_renderer.lua b/Source/Asura.Framework/graphics/sprite_renderer.lua index 925e8b1..93937d7 100644 --- a/Source/Asura.Framework/graphics/sprite_renderer.lua +++ b/Source/Asura.Framework/graphics/sprite_renderer.lua @@ -10,3 +10,5 @@ end function SpriteRenderer:OnRender() end + +return SpriteRenderer
\ No newline at end of file |