Advertisement
xerpi

vita sample

Apr 22nd, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.68 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 void Main(string[] args)
  18.         {
  19.             Initialize();
  20.             while (true)
  21.             {
  22.                 SystemEvents.CheckEvents();
  23.                 Update();
  24.                 Render ();
  25.             }
  26.         }
  27.         private static void Update(){
  28.             foreach (var touchData in Touch.GetData(0)) {
  29.                 if (touchData.Status == TouchStatus.Down ||
  30.                     touchData.Status == TouchStatus.Move) {
  31.                     imagebox1.X = (touchData.X + 0.5f) * 960 - 25.0f;
  32.                     imagebox1.Y = (touchData.Y + 0.5f) * 544 - 25.0f;
  33.                     //break;
  34.                 }
  35.             }          
  36.         }
  37.            
  38.         private static void Initialize()
  39.         {
  40.             graphics = new GraphicsContext();
  41.             scene = new Sce.Pss.HighLevel.UI.Scene();
  42.             UISystem.Initialize (graphics);
  43.             label1 = new Label();
  44.             imagebox1 = new ImageBox();
  45.             imagebox1.Image = new ImageAsset("/Application/lol.png",true);
  46.             imagebox1.X = 50;
  47.             imagebox1.Y = 50;
  48.             imagebox1.SetSize (50,50);
  49.             label1.Y = 0;
  50.             label1.X = 0;
  51.             label1.Width = 400;
  52.             label1.Text = "UI Toolkit Test";
  53.             label1.TextColor = new UIColor(0,255,0,255);
  54.             scene.RootWidget.AddChildLast(label1);
  55.             scene.RootWidget.AddChildLast(imagebox1);
  56.             UISystem.SetScene(scene,null);
  57.         }  
  58.         private static void Render()
  59.         {
  60.             graphics.SetClearColor(0,0,0,255);
  61.             graphics.Clear ();
  62.             UISystem.Render ();
  63.             graphics.SwapBuffers ();               
  64.         }
  65.        
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement