PaletteGet() public method

Gets a color from the display's palette.
public PaletteGet ( byte index ) : System.Color
index byte
return System.Color
Beispiel #1
0
        public Motherboard(VirtualMachine virtualMachine, TextDisplay textDisplay)
        {
            display = textDisplay;

            debugger = new Debugger(virtualMachine);
            random = new Random();

            timers = new Timer[4];
            for (var i = 0; i < timers.Length; i++)
            {
                timers[i] = new Timer();
            }

            originalPalette = new Color[256];
            for (var i = 0; i < originalPalette.Length; i++)
            {
                originalPalette[i] = display.PaletteGet((byte)i);
            }
        }
Beispiel #2
0
        public Display(byte id, VirtualMachine machine, RenderWindow window)
        {
            Id = id;

            _machine = machine;
            _window = window;

            _textDisplay = new TextDisplay(80, 25);

            _graphicsDisplay = new GraphicsDisplay(320, 200);
            _graphicsDisplay.Scale = new Vector2f(2, 2);

            _cursorEnabled = false;
            _cursorVisible = false;
            _cursorTimer = Stopwatch.StartNew();

            var cursorSize = new Vector2f(_textDisplay.CharacterWidth, _textDisplay.CharacterHeight * 0.15f);
            _cursor = new RectangleShape(cursorSize);
            _cursor.Origin = new Vector2f(0, -(_textDisplay.CharacterHeight * 0.85f));
            _cursor.FillColor = _textDisplay.PaletteGet(15);

            ChangeVideoMode(VideoMode.Text);
        }