-
-
Save johngirvin/28a5f8dc7f9889c0603dc3b33fc7c956 to your computer and use it in GitHub Desktop.
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
public class Game1 : Core | |
{ | |
protected override void Initialize() | |
{ | |
base.Initialize(); | |
Input.touch.enableTouchSupport(); | |
Scene.setDefaultDesignResolution(304, 240, Scene.SceneResolutionPolicy.ShowAll); | |
scene = new TestScene(); | |
} | |
} |
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
public class TestScene : Scene | |
{ | |
public override void initialize() | |
{ | |
addRenderer(new DefaultRenderer()); | |
var canvas = createEntity("ui").addComponent(new UICanvas()); | |
canvas.isFullScreen = false; | |
var table = canvas.stage.addElement(new Table()); | |
table.setFillParent(true); | |
table.add(new TextButton("X", TextButtonStyle.create(Color.Black, Color.DarkGray, Color.Gray))) | |
.setMinWidth(30).setMinHeight(30).setAlign(Align.center) | |
.getElement<Button>().onClicked += onClicked; | |
} | |
private void onClicked(Button obj) | |
{ | |
Debug.log("OnClicked"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment