コード例 #1
0
        void DrawDragMark(Control dragged)
        {
            float s  = dragged.DragMarkSize;
            float x0 = input.pointerX;
            float y0 = input.pointerY;
            float x1 = x0 - (s * 0.5f);
            float y1 = y0 - s;
            float x2 = x0 + (s * 0.5f);
            float y2 = y0 - s;

            // 背景
            Renderer.Color = dragged.DragMarkColor;
            Renderer.AddTriangle(x0, y0, x1, y1, x2, y2);
            // 枠
            Renderer.Color = new Color32(255, 255, 255, 255);
            Renderer.AddTriangleFrame(x0, y0, x1, y1, x2, y2, s * 0.125f);
            // テキスト
            if (dragged.DragMarkLetter != '\0')
            {
                Renderer.Color = dragged.DragMarkLetterColor;
                Renderer.AddText(
                    new string(dragged.DragMarkLetter, 1),
                    x0,
                    y0,
                    s * 0.5f,
                    AlignX.Center,
                    AlignY.Center);
            }
        }
コード例 #2
0
        public void Draw(GameTime gameTime)
        {
            renderer.Clear();

            foreach (var primitive in world.Primitives)
            {
                //if (world.Transformations.IndexExists(primitive.Key))
                //{
                var trans = world.Transformations[primitive.Key];
                renderer.AddPrimitive(primitive.Value.Geometry, Matrix.CreateWorld(trans.Position, trans.Forward, trans.Up));
                //}
            }

            foreach (var model in world.Models)
            {
                //if (world.Transformations.IndexExists(model.Key))
                //{
                var trans = world.Transformations[model.Key];
                renderer.AddModel(model.Value, Matrix.CreateWorld(trans.Position, trans.Forward, trans.Up));
                //}
            }

            foreach (var player in world.Players)
            {
                //if (world.Transformations.IndexExists(player.Key))
                //{
                var trans = world.Transformations[player.Key];
                renderer.AddText(player.Value.Font, player.Value.Name, Matrix.CreateWorld(trans.Position, trans.Forward, trans.Up));
                //}
            }
        }