Beispiel #1
0
        //funkcja startowa podglądu aktualnie wybranego fragmentu tilesetu.
        void SetupPreviewInfo()
        {
            //dodaje startowy podgląd
            currentTile = new Image(TILESET_PATH.Texture);
            currentTile.ClippingRegion = GetTexture(1);
            currentTile.AtlasRegion    = GetTexture(0);
            tilePreview.AddGraphicsToWindow(3, 3, currentTile);

            tilePreviewInfo = new RichText("", 12);
            tilePreview.AddTextToWindow(3, 96, tilePreviewInfo);
        }
Beispiel #2
0
        // main public m8
        public Akcja(Scene s, string st, Image img)
        {
            usedScene      = s;
            TILESET_PATH   = img;
            TILESET_STRING = st;

            SetupEdges();

            MAIN_TILEMAP = new Tilemap(st, 64 * 32, 32);
            SetupTiles();

            Instance = this;

            //TODO: edytować nazwy klas i ogarnąć kod \//\//\/\/\ w klasie Settings
            set = new Settings(this);

            //forcuje odswierzenie podgladu
            updatePreview = true;
            updatePos     = true;

            // dodaje okno wyboru fragmentów
            CWindow tilesChooser = new CWindow(Akcja.TILESET_PATH.Width + 6, Akcja.TILESET_PATH.Height + 6, 5, 10, Color.Gray, "Tiles");

            tilesChooser.AddGraphicsToWindow(3, 3, Akcja.TILESET_PATH); // funcja dodająca grafike
            tilesChooser.AddButtonsForTiles();                          // TODO: Połączyć tą i funkcje wyzej, tak jak jest to w CWindow-options.
            usedScene.Add(tilesChooser);

            // okienko z informacjami fragmentu/podgląd
            tilePreview = new CWindow(100, 140, Akcja.TILESET_PATH.Width + 6 + 6, 10, Color.Gray, "Info");
            usedScene.Add(tilePreview);

            // ...
            SetupPreviewInfo();

            // okno opcji, zapis/wczytaj/pomoc/quit/clear
            CWindow options = new CWindow(184, 54, 5, Akcja.TILESET_PATH.Height + 6 + 1 + 45, Color.Red, "Options");

            options.AddButtonsForOptions();
            options.AddTextToWindow(4, 40, new RichText("Made by Daawson", 10));//witam
            usedScene.Add(options);
        }