public AutoTile(Texture baseTexture, bool wallMode = false) { Textures = new Dictionary<PartType, IDrawable>(); BaseTexture = baseTexture; Build(wallMode); }
public LabeledWidget(Texture picture = null, EMode mode = DEFAULT_MODE) : base() { if (picture != null) { Mode = mode; Type = EType.Picture; Picture = new Button(picture, null); Picture.Dimension = new SFML.Window.Vector2f(DEFAULT_PICTURE_SIZE, DEFAULT_PICTURE_SIZE); switch (Mode) { case EMode.Left: case EMode.Right: HBox = new HAutoSizeBox(true, null, DEFAULT_BOXPICTURE_OFFSET); AddWidget(HBox); break; case EMode.Top: case EMode.Bottom: VBox = new VAutoSizeBox(true, null, DEFAULT_BOXPICTURE_OFFSET); AddWidget(VBox); break; } } }
void TileSetCreateButton_Clicked(object sender, SFML.Window.MouseButtonEventArgs e) { if (TextureButton.Text == Button.EMPTY_LABEL) { CallInformationDialogBox(InformationDialogBox.EType.Error, new String[] { InformationDialogBox.Instance.GetTextureErrorStr() }); return; } CurrentTileList.Clear(); Int32 width = (Int32)(CurrentTileSetTexture.Dimension.X / GameData.TILE_SIZE); Int32 height = (Int32)(CurrentTileSetTexture.Dimension.Y / GameData.TILE_SIZE); Int32 count = 0; for (Int32 y = 0; y < height; ++y) { for (Int32 x = 0; x < width; ++x) { BlazeraLib.Texture tileTexture = new BlazeraLib.Texture(CurrentTileSetTexture); tileTexture.ImageSubRect = new BlazeraLib.IntRect( x * GameData.TILE_SIZE, y * GameData.TILE_SIZE, x * GameData.TILE_SIZE + GameData.TILE_SIZE, y * GameData.TILE_SIZE + GameData.TILE_SIZE); tileTexture.SetType("Tile_" + CurrentTileSetTexture.Type + "_" + count); //tileTexture.ToScript(); Tile tile = new Tile(); tile.SetType(CurrentTileSetTexture.Type + "_" + count); tile.Texture = tileTexture; //tile.ToScript(); ++count; AddTile(tile); } } TileSelector.SetTileSet(CurrentTileList, width, OnTextureModeTileClick); }
void OnTextureManValidated(WindowedWidget sender, ValidateEventArgs e) { CurrentTileSetTexture = e.GetArg<BlazeraLib.Texture>("Texture"); TextureButton.Text = CurrentTileSetTexture.Type; }
public void AddButton(Texture picture, CheckEventHandler onChecked = null, LabeledWidget.EMode mode = DEFAULT_BUTTON_MODE, String name = null) { AddButton(new Item(picture, mode, RadioButtons.Count == 0) { Name = name }, onChecked); }
public Item(Texture picture, LabeledWidget.EMode mode = LabeledWidget.DEFAULT_MODE, Boolean isChecked = DEFAULT_STATE) : base(picture, mode) { TextureN = Create.Texture("Gui_RadioButtonN"); TextureN.Dimension *= RESIZE_FACTOR; TextureC = Create.Texture("Gui_RadioButtonC"); TextureC.Dimension *= RESIZE_FACTOR; Box = new Button(TextureN, null); Box.Clicked += new ClickEventHandler(Button_Clicked); GetLabelWidget().Clicked += new ClickEventHandler(Button_Clicked); AddLabeledWidget(Box); SetIsChecked(isChecked); IsActive = true; }
//!\\ TODO //!\\ public void SetSettings(Texture skin, IntRect rect) { // SetSkin(skin); AddSkin("Closed", Create.Texture("Door_C")); AddSkin("Open", Create.Texture("Door_wood_O")); AddSkin("Locked", Create.Texture("Door_C")); Area = rect != null ? rect : new IntRect(0, 0, (int)Dimension.X, (int)Dimension.Y); }
public void SetBase(Texture baseTexture, int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT, int highness = DEFAULT_HIGHNESS) { BaseTexture = baseTexture; AutoTile = new AutoTile(BaseTexture); WallAutoTile = new AutoTile(BaseTexture, true); Width = width; Height = height; Highness = highness; GroundTextures = new IDrawable[Height, Width]; WallTextures = new IDrawable[Highness, Width]; Build(); }
void objectButton_Clicked(object sender, MouseButtonEventArgs e) { CurrentSelectedObjectExternalBoundingBoxes.Clear(); if (CurrentSelectedObject != null) CurrentSelectedObject.Color = SelectedObjects.ContainsValue(CurrentSelectedObject) ? SelectorTool.OBJECT_SELECTION_COLOR : Color.White; CurrentSelectedObject = SelectedObjects[((Button)sender).Text]; CurrentSelectedObjectTexture = new BlazeraLib.Texture(SelectedObjects[((Button)sender).Text].GetSkinTexture()); CurrentSelectedObjectTexture.Color = Color.White; SelectorToolCurrentObjectDisplayScreen.SetCurrentPicture(CurrentSelectedObjectTexture); CurrentSelectedObject.Color = CURRENT_SELECTED_OBJECT_COLOR; SelectorToolCurrentObjectConfigurableBox.SetCurrentConfiguration(CurrentSelectedObject.GetType().Name); SelectorToolElementXUpDownBox.SetCurrentValue((Int32)CurrentSelectedObject.Position.X); SelectorToolElementYUpDownBox.SetCurrentValue((Int32)CurrentSelectedObject.Position.Y); SelectorToolElementEventTextList.Clear(); foreach (EBoundingBox BB in CurrentSelectedObject.GetEventBoundingBoxes(EventBoundingBoxType.External)) AddBoundingBoxToCurrentSelectedObject(BB); }