Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using Sce.Pss.Core;
- using Sce.Pss.Core.Environment;
- using Sce.Pss.Core.Graphics;
- using Sce.Pss.Core.Input;
- using Sce.Pss.HighLevel.UI;
- namespace lol
- {
- public class lol
- {
- public static Scene scene;
- public static Label label1;
- public static ImageBox imagebox1;
- public static GraphicsContext graphics;
- public static void Main(string[] args)
- {
- Initialize();
- while (true)
- {
- SystemEvents.CheckEvents();
- Update();
- Render ();
- }
- }
- private static void Update(){
- foreach (var touchData in Touch.GetData(0)) {
- if (touchData.Status == TouchStatus.Down ||
- touchData.Status == TouchStatus.Move) {
- imagebox1.X = (touchData.X + 0.5f) * 960 - 25.0f;
- imagebox1.Y = (touchData.Y + 0.5f) * 544 - 25.0f;
- //break;
- }
- }
- }
- private static void Initialize()
- {
- graphics = new GraphicsContext();
- scene = new Sce.Pss.HighLevel.UI.Scene();
- UISystem.Initialize (graphics);
- label1 = new Label();
- imagebox1 = new ImageBox();
- imagebox1.Image = new ImageAsset("/Application/lol.png",true);
- imagebox1.X = 50;
- imagebox1.Y = 50;
- imagebox1.SetSize (50,50);
- label1.Y = 0;
- label1.X = 0;
- label1.Width = 400;
- label1.Text = "UI Toolkit Test";
- label1.TextColor = new UIColor(0,255,0,255);
- scene.RootWidget.AddChildLast(label1);
- scene.RootWidget.AddChildLast(imagebox1);
- UISystem.SetScene(scene,null);
- }
- private static void Render()
- {
- graphics.SetClearColor(0,0,0,255);
- graphics.Clear ();
- UISystem.Render ();
- graphics.SwapBuffers ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement