コード例 #1
0
 public LogoScreen(TextureObject logo, Data.UI.DrawableGameScreen next)
     : base(true)
 {
     EngineGlobals.GameReference.ClearColor = Color.Black;
     _logoColor = Color.Black;
     _logo = logo;
     nextScreen = next;
 }
コード例 #2
0
 public override void Update(float dt)
 {
     if (_timeOn < screen_on_time)
     {
         _timeOn += dt;
     }
     else
     {
         _stateManager.AddScreenLoad(new TitleScreen());
         _stateManager.RemoveScreen(this);
     }
     if (_timeOn < 1)
     {
         _logoColor = Color.Lerp(Color.Black, Color.White, _timeOn / 1);
     }
     else if (_timeOn > screen_on_time - 1)
     {
         _logoColor = Color.Lerp(Color.White, Color.Black, (_timeOn - (screen_on_time - 1)) / 1);
     }
 }
コード例 #3
0
        public override void Draw(Equestribatch sb)
        {
            if (!entryComplete)
                _displayColor = Color.Multiply(Color.White, timer / ENTRYTIME);
            if (delayComplete && !exitComplete)
                _displayColor = Color.Multiply(Color.White, 1 - (timer / EXITTIME));
            sb.Begin();

            if(entryComplete && !displayComplete)
                sb.DrawString(_fontDisplay,(goldRecieved >= 0 ? "+" : "") + goldRecieved,
                    Vector2.Lerp(_displayPos,_displayPos - new Vector2(0,128),timer / DISPLAYTIME),
                    Color.Multiply(goldRecieved >= 0 ? Color.Yellow : Color.Red,1 - (timer/DISPLAYTIME)));

            //sb.DrawString(_fontDisplay, "" + goldDisplayed, _displayPos + Vector2.One, );
            sb.DrawString(_fontDisplay, "" + goldDisplayed, _displayPos, _displayColor);
            sb.Draw(_bits.Texture, _displayPos - new Vector2(38, -8), _displayColor);

            sb.End();

            base.Draw(sb);
        }
コード例 #4
0
        public void Draw(TextureObject textureObject, Vector2 position, Rectangle? sourceRect,
    Color color, float rotation, Vector2 origin, Vector2 scale, int effects, float depth)
        {
            SpriteEffects sfx;
            switch (effects)
            {
                case 1:
                    sfx = SpriteEffects.FlipHorizontally;
                    break;
                case 2:
                    sfx = SpriteEffects.FlipVertically;
                    break;
                case 3:
                    sfx = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically;
                    break;
                default:
                    sfx = SpriteEffects.None;
                    break;
            }

            base.Draw(textureObject.Texture, position, sourceRect, color, rotation, origin, scale, sfx, depth);
        }
コード例 #5
0
        public static void GenerateTextureObjectFromPopText(out TextureObject output,int num, Color? color = null)
        {
            TextureAtlas atlas = EquestriEngine.AssetManager.GetTexture("{pop_text}") as TextureAtlas;

            string temp = "" + num;
            int width = 0, height = 0;

            for (int i = 0; i < temp.Length; i++)
            {
                var rect = atlas["num_" + temp[i]];
                width += rect.Width;
                if (rect.Height > height)
                    height = rect.Height;
            }

            RenderTarget2D _textTarget = new RenderTarget2D(Device_Ref,width,height);
            Device_Ref.SetRenderTarget(_textTarget);
            Device_Ref.Clear(color == null ? Color.Black : color.Value);

            Equestribatch batch = new Equestribatch(Device_Ref);
            batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            int lastWidth = 0;
            for (int i = 0; i < temp.Length; i++)
            {
                batch.Draw(atlas.Texture, new Vector2(lastWidth, 0), atlas["num_" + temp[i]], Color.White);
                lastWidth += atlas["num_" + temp[i]].Width;
            }

            batch.End();

            Device_Ref.SetRenderTarget(null);

            output = EquestriEngine.AssetManager.CreateTextureObjectFromTarget("{"+temp+"}", _textTarget);

            _textTarget.Dispose();
        }
コード例 #6
0
 public static Color Multiply(Color color, float amount)
 {
     return ColorRGBA.Multiply(color, amount);
 }
コード例 #7
0
 public static Color Lerp(Color colorA,Color colorB, float amount)
 {
     return ColorRGBA.Lerp(colorA,colorB,amount);
 }
コード例 #8
0
 public GameOverScreen()
     : base(true)
 {
     EngineGlobals.GameReference.ClearColor = Color.Black;
     _logoColor = Color.Black;
 }
コード例 #9
0
        public static void GenerateTextureObjectFromMethod(TargetObject input, out TextureObject output,string name, System.Action<Equestribatch> method, Color? color = null,EffectObject effect = null)
        {
            input.RunTarget(method,color,effect);

            output = new TextureObject(name, input.Texture,true);
        }
コード例 #10
0
 public void Draw(TextureObject textureObject, Rectangle destRect, Rectangle? sourceRect, Color color)
 {
     base.Draw(textureObject.Texture, destRect, sourceRect, color);
 }
コード例 #11
0
 public void Draw(TextureObject textureObject, Vector2 position, Rectangle? sourceRect, Color color)
 {
     base.Draw(textureObject.Texture, position, sourceRect, color);
 }
コード例 #12
-1
 public ConsoleWindow(object game)
     : base(game)
 {
     _font = EquestriEngine.AssetManager.CreateFontFromFile("{console}", @"fonts\celestia_redux");
     _consoleColor = Color.Multiply(Color.White, 0.5f);
     _currentMode = ConsoleMode.Console;
     _consoleInput = new Variable("");
     _entries = "";
     process = System.Diagnostics.Process.GetCurrentProcess();
 }