瀏覽代碼

Added SpriteMode.Fixed

Mark Sibly 7 年之前
父節點
當前提交
07ff59db31
共有 2 個文件被更改,包括 7 次插入3 次删除
  1. 2 0
      VERSIONS.TXT
  2. 5 3
      modules/mojo3d/scene/entities/sprite.monkey2

+ 2 - 0
VERSIONS.TXT

@@ -1,4 +1,6 @@
 
+Added SpriteMode.Fixed for sprites unaffected by camera.
+
 Fixed entity.Color and Entity.Alpha not affecting sprites.
 
 Experimental fix for Mojave vsync not working. Removed support for Window.SwapAsync as it breaks on macos.

+ 5 - 3
modules/mojo3d/scene/entities/sprite.monkey2

@@ -7,11 +7,13 @@ Namespace mojo3d
 |:--------------|:-----------
 | `Billboard`	| Sprite always faces the camera, eg: like a lens flare.
 | `Upright`		| Sprite faces the camera but remains upright, eg: like a tree.
+| `Fixed`		| Sprite is not affected by the camera.
 
 #end
 Enum SpriteMode
-	Billboard=1
-	Upright=2
+	Billboard=0
+	Upright=1
+	Fixed=2
 End
 
 #rem monkeydoc The Sprite class.
@@ -135,6 +137,6 @@ Class Sprite Extends Renderable
 	Field _material:Material
 	Field _textureRect:=New Rectf( 0,0,1,1 )
 	Field _handle:Vec2f=New Vec2f( .5,.5 )
-	Field _mode:SpriteMode=Null
+	Field _mode:SpriteMode
 	
 End