-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for rendering BitmapFonts in 3D
- Loading branch information
Evrim Öztamur
committed
Sep 28, 2020
1 parent
8e007af
commit d604a48
Showing
4 changed files
with
142 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Dungeoneer/src/com/interrupt/dungeoneer/entities/NeoText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.interrupt.dungeoneer.entities; | ||
|
||
import com.badlogic.gdx.graphics.Color; | ||
import com.interrupt.dungeoneer.annotations.EditorProperty; | ||
import com.interrupt.dungeoneer.gfx.drawables.DrawableText; | ||
|
||
public class NeoText extends DirectionalEntity { | ||
|
||
@EditorProperty | ||
public String text = "Test"; | ||
|
||
@EditorProperty | ||
public Color textColor = Color.WHITE; | ||
|
||
public NeoText() { | ||
this.drawable = new DrawableText(this.text); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Dungeoneer/src/com/interrupt/dungeoneer/gfx/drawables/DrawableText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.interrupt.dungeoneer.gfx.drawables; | ||
|
||
import com.badlogic.gdx.graphics.Color; | ||
import com.badlogic.gdx.math.Vector3; | ||
import com.interrupt.dungeoneer.entities.Entity; | ||
import com.interrupt.dungeoneer.entities.NeoText; | ||
|
||
public class DrawableText extends Drawable { | ||
|
||
public String text = ""; | ||
public Color worldColor = Color.WHITE; | ||
public Vector3 parentPosition = new Vector3(); | ||
public Vector3 parentRotation = new Vector3(); | ||
public Entity.EditorState editorState = Entity.EditorState.hovered; | ||
public Color pickingColor = Color.BLACK; | ||
|
||
public DrawableText() { | ||
} | ||
|
||
public DrawableText(String text) { | ||
this.text = text; | ||
} | ||
|
||
public void update(Entity e) { | ||
if (e instanceof NeoText) { | ||
text = ((NeoText) e).text; | ||
color.set(((NeoText) e).textColor); | ||
} | ||
|
||
scale = e.scale; | ||
|
||
parentPosition.set(e.x, e.y, e.z); | ||
parentRotation.set(e.getRotation()); | ||
|
||
editorState = e.editorState; | ||
} | ||
} |