public UIBackground(string _Name, Control _Parent)
     : base(_Name, _Parent)
 {
     Transformation = new Float3x3(1, 0, 0, 0, 1, 0, 0, 0, 1);
     shader = ShaderCompiler.Compile(System.IO.File.ReadAllText("Default.fx"));
     OnControllerInput += new OnControllerInputHandler(UIButton_OnControllerInput);
 }
示例#2
0
 public UIFloor(string _Name, Control _Parent)
     : base(_Name, _Parent)
 {
     RelativeToParent = false;
     ZoomedTransform = new Float3x3(0.9f, 0, 0, 0, 0.9f, 0, 0, 0, 1);
     OnControllerInput += new OnControllerInputHandler(UIButton_OnControllerInput);
 }
示例#3
0
        public UIAnalog(string _Name, Control _Parent)
            : base(_Name, _Parent)
        {
            Transformation = new Float3x3(0.1f, 0, 0, 0, 0.1f, 0, 0, 0, 1);
            ZoomedTransformation = new Float3x3(0.9f, 0, 0, 0, 0.9f, 0, 0, 0, 1);

            font = new SpriteFont("./content/Arial.png", "./content/Arial.xml");
            NormalTransformation = Transformation;
            OnControllerInput += new OnControllerInputHandler(UIButton_OnControllerInput);
        }
示例#4
0
        public UIButton(string _Name, Control _Parent)
            : base(_Name, _Parent)
        {
            Transformation = new Float3x3(0.1f, 0, 0, 0, 0.1f, 0, 0, 0, 0);
            shader = ShaderCompiler.Compile(System.IO.File.ReadAllText("Default.fx"));
            loadingshader = ShaderCompiler.Compile(System.IO.File.ReadAllText("Loading.fx"));

            font = new SpriteFont("./content/Arial.png", "./content/Arial.xml");

            OnControllerInput += new OnControllerInputHandler(UIButton_OnControllerInput);
        }
示例#5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="_Name">Name of the Control</param>
 /// <param name="_Parent">Parent Control</param>
 public Control(string _Name, Control _Parent)
 {
     name = _Name;
     Parent = _Parent;
     if (Parent != null) Parent.AddChild(this);
 }
 public GenericBrowser(Control _Parent)
     : base("GenericBrowser", _Parent)
 {
     OnRender += GenericBrowser_OnRefresh;
 }
 public GenericBrowserHeader(string _Name, Control _Parent)
     : base(_Name, _Parent)
 {
     OnRender += OnDraw;
 }
示例#8
0
        public Form1()
        {
            InitializeComponent();

            Graphics.Initialize(this.Handle, TargetResolution);
            ClientResources.Load();
            ScreenSaverTarget = new RenderTarget(TargetResolution);
            ScreenSaverWobbleTarget = new RenderTarget(TargetResolution / 8, RenderTarget.SurfaceFormat.Float4Half);
            ScreenSaverShader = ShaderCompiler.Compile(System.IO.File.ReadAllText("screensaver.fx"));
            ScreenSaverBuffer = new TextureGPU(TargetResolution);

            ScreenSaverDroplet = new TextureGPUResource("./content/droplet.png");

            //Root = new GenericBrowser(null);
            #if true
            Root = new UIBackground("", null);

            UIFloor floor4 = new UIFloor("floor4", Root); floor4.Level = 3;
            UIFloor floor3 = new UIFloor("floor3", Root); floor3.Level = 2;
            UIFloor floor2 = new UIFloor("floor2", Root); floor2.Level = 1;
            UIFloor floor1 = new UIFloor("floor1", Root); floor1.Level = 0;

            Floors.Add(floor1);
            Floors.Add(floor2);
            Floors.Add(floor3);
            Floors.Add(floor4);

            Control button1 = new UIButton("b1", floor4);
            button1.Transformation = Float3x3.Scale(0.1f) * Float3x3.Translate(new Float2(1, 1));

            Control button2 = new UIAnalog("b2", floor4);
            button2.Transformation = Float3x3.Scale(0.1f) * Float3x3.Translate(new Float2(0, 0));

            UIProgressBar progress = new UIProgressBar("p1", floor4);
            progress.Transformation = Float3x3.Scale(new Float2(0.3f, 0.1f)) * Float3x3.Translate(new Float2(0, 0.5f));
            progress.Value = 50;
            #else
            Control button1 = new UIButton("b1", null);
            button1.Transformation = Float3x3.Translate(new Float2(0.5f, 0.5f)) * Float3x3.Scale(0.1f);
            Control button2 = new UIAnalog("b2", null);
            button2.Transformation = Float3x3.Translate(new Float2(0.5f, -0.5f)) * Float3x3.Scale(0.1f);
            Control button3 = new UIAnalog("b3", null);
            button3.Transformation = Float3x3.Translate(new Float2(-0.5f, 0.5f)) * Float3x3.Scale(0.1f);
            Control button4 = new UIAnalog("b4", null);
            button4.Transformation = Float3x3.Translate(new Float2(-0.5f, -0.5f)) * Float3x3.Scale(0.1f);

            ((UIButton)button1).Text = "button1";
            ((UIAnalog)button2).Text = "button2";
            ((UIAnalog)button3).Text = "button3";
            ((UIAnalog)button4).Text = "button4";

            Root = new UIBackground("", null);

            Root.AddChild(button1);
            Root.AddChild(button2);
            Root.AddChild(button3);
            Root.AddChild(button4);
            #endif
            //Root.Transformation = Float3x3.Scale(new Float2(2, -2)) * Float3x3.Translate(new Float2(-0.5f, -0.5f));
            System.Windows.Forms.Application.Idle += new EventHandler(Application_Idle);
        }
 public UIProgressBar(string _Name, Control _Parent)
     : base(_Name, _Parent)
 {
     OnControllerInput += new OnControllerInputHandler(UIButton_OnControllerInput);
 }