Advertisement
xerpi

dfdfdf

Apr 22nd, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. using Sce.Pss.Core;
  5. using Sce.Pss.Core.Environment;
  6. using Sce.Pss.Core.Graphics;
  7. using Sce.Pss.Core.Input;
  8. using Sce.Pss.HighLevel.UI;
  9. namespace lol
  10. {
  11.     public class lol
  12.     {
  13.         public  static Scene scene;
  14.         public  static Label label1;
  15.         public  static ImageBox imagebox1;
  16.         public  static GraphicsContext graphics;
  17.         //public  static TouchData touchData;
  18.         public  static void Main(string[] args)
  19.         {
  20.             Initialize();
  21.             while (true)
  22.             {
  23.                 SystemEvents.CheckEvents();
  24.                 Update();
  25.                 Render ();
  26.             }
  27.         }
  28.         private static void Update(){
  29.             foreach (var touchData in Touch.GetData(0)) {
  30.                 if (touchData.Status == TouchStatus.Down ||
  31.                     touchData.Status == TouchStatus.Move) {
  32.                     imagebox1.X = (touchData.X + 0.5f) * 960;
  33.                     imagebox1.Y = (touchData.Y + 0.5f) * 544;
  34.                     break;
  35.                 }
  36.             }          
  37.         }
  38.            
  39.         private static void Initialize()
  40.         {
  41.             graphics = new GraphicsContext();
  42.             //touchData = new TouchData();
  43.             scene = new Sce.Pss.HighLevel.UI.Scene();
  44.             UISystem.Initialize (graphics);
  45.             label1 = new Label();
  46.             imagebox1 = new ImageBox();
  47.             imagebox1.Image = new ImageAsset("/Application/lol.png",true);
  48.             imagebox1.X = 50;
  49.             imagebox1.Y = 50;
  50.             imagebox1.SetSize (50,50);
  51.             label1.Y = 0;
  52.             label1.X = 0;
  53.             label1.Width = 400;
  54.             label1.Text = "UI Toolkit Test";
  55.             label1.TextColor = new UIColor(0,255,0,255);
  56.             scene.RootWidget.AddChildLast(label1);
  57.             scene.RootWidget.AddChildLast(imagebox1);
  58.             UISystem.SetScene(scene,null);
  59.         }  
  60.         private static void Render()
  61.         {
  62.             graphics.SetClearColor(0,0,0,255);
  63.             graphics.Clear ();
  64.             UISystem.Render ();
  65.             graphics.SwapBuffers ();               
  66.         }
  67.        
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement