Exemple #1
0
        void UIAttributeParser.ParseAttribute(UINode node)
        {
            /**
             * font = 10
             * textColor = (255,249,157)
             * textColorSelected = (0,243,247)
             * textColorHighlighted = (255,255,255)
             * textColorDisabled = (100,100,100)
             */

            var fontSize = 10;

            if (node.Attributes.ContainsKey("font"))
            {
                fontSize = int.Parse(node.Attributes["font"]);
            }

            var fontColor = TextStyle.DefaultButton.Color;

            if (node.Attributes.ContainsKey("textColor"))
            {
                fontColor = UIScript.ParseRGB(node.Attributes["textColor"]);
            }
            if (node.Attributes.ContainsKey("color"))
            {
                fontColor = UIScript.ParseRGB(node.Attributes["color"]);
            }

            if (node.Attributes.ContainsKey("textColorSelected"))
            {
                SelectedColor = UIScript.ParseRGB(node.Attributes["textColorSelected"]);
            }
            if (node.Attributes.ContainsKey("textColorHighlighted"))
            {
                HighlightedColor = UIScript.ParseRGB(node.Attributes["textColorHighlighted"]);
            }
            if (node.Attributes.ContainsKey("textColorDisabled"))
            {
                DisabledColor = UIScript.ParseRGB(node.Attributes["textColorDisabled"]);
            }


            if (node.Attributes.ContainsKey("cursorColor"))
            {
                CursorColor = UIScript.ParseRGB(node.Attributes["cursorColor"]);
            }

            Font  = GameFacade.MainFont;
            VFont = GameFacade.VectorFont;
            Size  = fontSize;
            Color = fontColor;
        }
Exemple #2
0
        public override void Load()
        {
            FontTest     = new MSDFFont("content/fonts/Hack.ttf");
            CrosshairTex = Importers.Load <Texture>("content/textures/crosshair_default.png");

            /*MSDF = new ShaderProgram(new ShaderStage(ShaderType.VertexShader, "content/shaders/default.vert"),
             * new ShaderStage(ShaderType.FragmentShader, "content/shaders/msdf.frag"));*/

            Ply = new Player();
            Engine.SpawnEntity(Ply);

            GameWorld    = new World("content/maps/sandbox.txt");
            Ply.Position = GameWorld.RelativeSpawns.FirstOrDefault();
            Engine.SpawnEntity(GameWorld);

            GConsole.RegisterCommand("getcam", () => {
                GConsole.WriteLine("Pos: " + Ply.Position.ToString());
            });
        }