public UIComp_DrawEditBoxText(Window owner) : base(owner) { normalTextColor = new Color4f(System.Drawing.Color.Black); selectTextColor = new Color4f(System.Drawing.Color.White); selectBrushColor = new ColorRect(new Color4f(0.2f, 0.6f, 1.0f)); cursorColor = new ColorRect(new Color4f(System.Drawing.Color.Black)); cursorSize = 1; m_StartOffset = 2; m_StartVisible = 0; m_VisibleCount = 0; m_First = ""; m_Mid = ""; m_Last = ""; FontDescription = FontDescription.DefaultFontDesc; InitEvent(owner); }
void SetUpgradeSquares() { maxSquares = dinoInfo.GetMaxLevel(statButtonMode); for (int i = 0; i < maxSquares; i++) { var newSquare = new ColorRect(); newSquare.Color = new Color(0, 0, 0, 0.5f); newSquare.RectMinSize = new Vector2(containerLength / maxSquares, containerHeight); newSquare.RectSize = newSquare.RectMinSize; // don't make new squares every time if (firstRun) { squaresContainer.AddChild(newSquare); } } firstRun = false; ColorSquares(); }
public override void _Ready() { if (!SettingsData.FileFound) { GetTree().Quit(); } //retrieve the scenes for beating a level and losing _gameOverScreen = ResourceLoader.Load <PackedScene>("res://scenes/menu/gameover/GameOver.tscn"); _youWinScreen = ResourceLoader.Load <PackedScene>("res://scenes/menu/youwin/YouWin.tscn"); _popLabel = GetNode <Label>("Display/Sprite/Ability1/PopUpTip/Popup/Label2"); _popRect = GetNode <ColorRect>("Display/Sprite/Ability1/PopUpTip/Popup/CanvasLayer/ColorRect"); _pop = GetNode <Popup>("Display/Sprite/Ability1/PopUpTip/Popup"); //initialize the vectore for movement and the intial gemcount and jumpcount _movement = new Vector2(); _jumpcount = 0; _attackcount = 0; _onground = false; //get player state from saved player states AllowedJumps = PlayerData.AllowedJumps; PlayerDamage = PlayerData.PlayerDamage; _gemcount = PlayerData.GemCount; FinalAttack = PlayerData.FinalAttack; //get some nodes for the player character to be used _display = GetNode <Node2D>("Display"); _damageArea = GetNode <Area2D>("Display/DamageArea"); //retrieve the animation player and set player's initial state _animationPlayer = GetNode <AnimationPlayer>("AnimationPlayer"); GD.Print(_animationPlayer.GetAnimationList()); _sprite = GetNode <Sprite>("Display/Sprite"); _animationPlayer.Play("idle"); _audioPlayer = GetNode <AudioStreamPlayer2D>("AudioStreamPlayer2D"); GetNode <Light>("Display/Light").DisableDimming = DisableDimming; }
public override void _Ready() { instance = this; CharacterSubMenu = GetNode <Control>(CharacterSubMenuPath); WeaponSlot = GetNode <Control>(WeaponSlotPath); nameLabel = GetNode <Label>(nameLabelPath); levelLabel = GetNode <Label>(levelLabelPath); vitPoints = GetNode <Label>(vitPointsPath); strPoints = GetNode <Label>(strPointsPath); intPoints = GetNode <Label>(intPointsPath); dexPoints = GetNode <Label>(dexPointsPath); expBar = GetNode <ColorRect>(expBarNodePath); hpLabel = GetNode <Label>(hpLabelPath); paLabel = GetNode <Label>(paLabelPath); maLabel = GetNode <Label>(maLabelPath); asLabel = GetNode <Label>(asLabelPath); unusedLabel = GetNode <Label>(unusedLabelPath); defenseLabel = GetNode <Label>(defenseLabelPath); hasteLabel = GetNode <Label>(hasteLabelPath); _Hide(); }
public void initialize(WorldEntry info) { worldEntry = info; GetNode <AnimatedSprite>("AnimatedSprite").Visible = false; GetNode <Control>("MainContainer").Visible = true; GetNode <Control>("RatingControl").Visible = true; GetNode <TextureRect>("MainContainer/IconTexture").Texture = info.Icon; GetNode <TextureRect>("MainContainer/IconTexture").RectSize = new Vector2(30, 30); GetNode <Label>("MainContainer/TextContainer/NameLabel").Text = $"{info.Name} ({info.Author})"; GetNode <Label>("MainContainer/TextContainer/DescriptionLabel").Text = info.Description; progressRect = GetNode <ColorRect>("ProgressRect"); startProgressLength = progressRect.RectSize.x - progressRect.MarginLeft; varProgressLength = RectSize.x - startProgressLength - progressRect.MarginLeft * 2; var rating_control = GetNode <Control>("RatingControl"); if (!worldEntry.HasServerInfo) { rating_control.Visible = false; RectMinSize = new Vector2(RectMinSize.x, 45); } else { rating_control.Visible = true; RectMinSize = new Vector2(RectMinSize.x, 55); rating_control.GetNode <Label>("SizeLabel").Text = $"{(worldEntry.FileSize / 1024f / 1024f):0.#} MB"; rating_control.GetNode <Label>("UpvotesLabel").Text = $"+{worldEntry.Upvotes}"; rating_control.GetNode <Label>("DownvotesLabel").Text = $"-{worldEntry.Downvotes}"; rating_control.GetNode <Label>("DownloadsLabel").Text = $"{worldEntry.Downloads}"; rating_control.GetNode <Label>("VerifiedLabel").Text = worldEntry.Approved ? "Approved" : worldEntry.Verified ? "Autoverified" : "Not Verified"; rating_control.GetNode <Label>("VerifiedLabel").AddColorOverride("font_color", worldEntry.Approved || worldEntry.Verified ? new Color(0, 0.5f, 0) : new Color(0.5f, 0, 0)); } }
public override void _Ready() { TimerSound = GetNode <AudioStreamPlayer>("TimerSound"); MoneyLabel = GetNode <Label>("CanvasLayer/MoneyLabel"); LaunchTimer = GetNode <Timer>("LaunchTimer"); LaunchLabel = GetNode <Label>("CanvasLayer2/Label"); SubBobTween = GetNode <Tween>("SubBobTween"); Water1Tween = GetNode <Tween>("Water1GrowTween"); Water1Rect = GetNode <ColorRect>("Water1Rect"); Water2Tween = GetNode <Tween>("Water2GrowTween"); Water2Rect = GetNode <ColorRect>("Water2Rect"); Water3Tween = GetNode <Tween>("Water3GrowTween"); Water3Rect = GetNode <ColorRect>("Water3Rect"); PlayerSub = GetNode <PlayerSub>("PlayerSub"); StartPlayerBobTween(); StartWater1Tween(); StartWater2Tween(); StartWater3Tween(); PlayerSub.OnSurface = true; PlayerSub.StartBubbler(false); CircleWipeAnimationPlayer = (AnimationPlayer)GetNode("CircleWipe/ColorRect/AnimationPlayer"); MoneyLabel.Text = "$" + GlobalManager.GetPlayerMoney(this); if (GlobalManager.LevelHasBeenPlayed(this)) { IsWipeIn = true; CircleWipeAnimationPlayer.Play("circle_out"); } GlobalManager.SetLevelHasBeenPlayed(this); }
public void ResizeBlock() { int hsep = (int)container.Get("custom_constants/hseparation"); int vsep = (int)container.Get("custom_constants/vseparation"); // assuming heps are always the same for now, since it has to be a square if (hsep == 0) { blockSize.x = this.GetSize().x / width; blockSize.y = this.GetSize().y / height; } else { blockSize.x = (this.GetSize().x) / width - hsep; blockSize.y = (this.GetSize().y) / height - vsep; } for (int i = 0; i < width * height; i++) { ColorRect rect = container.GetChild(i) as ColorRect; rect.SetCustomMinimumSize(blockSize); } }
public LoadGameScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master) { Texture2D up = Load <Texture2D>("Image/buttonUp"); Texture2D down = Load <Texture2D>("Image/buttonDown"); SpriteFont font = Load <SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black); bg = c; Label t = new Label(widthScreen / 2, 10, font, "Load Game"); t.x -= (int)t.GetDim().X / 2; title = t; Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back"); back.select += delegate() { ChangeScreen <MainMenuScreen>(); }; buttons.Add(back); }
public SelectScreen2(int width, int height, IScreenMaster master) : base(width, height, master) { input = Settings.in2; Texture2D up = Load <Texture2D>("Image/buttonUp"); Texture2D down = Load <Texture2D>("Image/buttonDown"); SpriteFont font = Load <SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black); bg = c; Label t = new Label(widthScreen / 2, 10, font, "P2, Select Character"); t.x -= (int)t.GetDim().X / 2; title = t; Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back"); back.select += delegate() { ChangeScreen <SelectScreen1>(); }; CharacterButton wasp = new CharacterButton(100, 100, LoadAnim("waspIdle"), up, down); wasp.select += delegate() { Settings.P2_FIGHTER = "wasp"; ChangeScreen <GameScreen>(); }; buttons.Add(wasp); CharacterButton beetle = new CharacterButton(180, 100, LoadAnim("beetleIdle"), up, down); beetle.select += delegate() { Settings.P2_FIGHTER = "beetle"; ChangeScreen <GameScreen>(); }; buttons.Add(beetle); buttons.Add(back); }
public override void _Ready() { colorRect = (ColorRect)GetNode("Border"); choice_one = (TextureRect)GetNode("P1Select"); choice_two = (TextureRect)GetNode("P2Select"); lockRect = (TextureRect)GetNode("Lock"); portaitRect = (TextureRect)GetNode("Portait"); portaitRect.Texture = portait; if (P1Check) { choice_one.Show(); } if (P2Check) { choice_two.Show(); } if (locked) { lockRect.Show(); } }
public override void _Ready() { room_name = GetNode <Label>("Graphics/room_name"); debug_indicator = GetNode <ColorRect>("Graphics/debug_square"); LoadRoomData(); // populate dependent room if (dependent_room_path != null) { dependent_room = GetNode <RoomScript>(dependent_room_path); if (dependent_room.room_abandoned) { room_abandoned = true; } } if (room_abandoned) { debug_indicator.Color = Colors.DimGray; } }
// values // Called when the node enters the scene tree for the first time. public override void _Ready() { colorect = GetNode <ColorRect>("ColorRect"); // the colorect node in the current node as a child }
public void SetTextColor(ColorEx color) { textColors = new ColorRect(color); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { _animationPlayer = (AnimationPlayer)GetNode("AnimationPlayer"); _colorRect = (ColorRect)GetNode("Control/FadeRect"); }
} //default ctor not valid - we want to enforce initializing our data public UIComp_DrawTexture(Window owner) : base(owner) { textureColor = new ColorRect(-1); }
public override void _Ready() { _shader = (ColorRect)GetNode("Shader"); }
public override void _Ready() { ColorRect pauseOverlay = GetNode <ColorRect>(ParentPath); }
public override void _Ready() { _anim = GetNode <AnimationPlayer>("Anim"); _curtain = GetNode <ColorRect>("Curtain"); }
public override void _Ready() { _bar = GetNode<ColorRect>("Bar/Green"); }
public override void _Ready() { timeLabel = GetNode <Label>("Time"); levelLabel = GetNode <Label>("Level"); Background = GetNode <ColorRect>("../Background"); }
public override void _Ready() { colorRect = GetNode <ColorRect>("ColorRect"); Position = new Vector2(-40, 16); }
public CharacterPlayer(int x, int y, Level level) : base(x, y, level) { if (level != null) { _camera = new Camera(); _camera.Current = true; switch (Type) { case CharacterType.Player_East: _camera.Transform = Transform.Identity.Rotated(Vector3.Up, Mathf.Pi * -0.5f); break; case CharacterType.Player_West: _camera.Transform = Transform.Identity.Rotated(Vector3.Up, Mathf.Pi * 0.5f); break; case CharacterType.Player_South: _camera.Transform = Transform.Identity.Rotated(Vector3.Up, Mathf.Pi * -1.0f); break; } _moveSpeed = Level.CellSize * 200.0f; _turnSpeed = 3f; _useRay = new RayCast(); _useRay.Enabled = true; _useRay.ExcludeParent = true; _useRay.CastTo = Vector3.Forward * (Level.CellSize * 0.5f); _useRay.CollisionMask = (uint)( Level.CollisionLayers.Characters | Level.CollisionLayers.Static | Level.CollisionLayers.Walls); _useRay.AddException(this); _camera.AddChild(_useRay); _flashDuration = 0.5f; _flashRect = new ColorRect(); _flashRect.MouseFilter = Control.MouseFilterEnum.Ignore; _flashRect.Color = new Color(0.75f, 0.75f, 0f, 1f); _flashRect.AnchorTop = _flashRect.AnchorLeft = 0f; _flashRect.AnchorRight = _flashRect.AnchorBottom = 1f; _flashRect.SetAsToplevel(true); _flashRect.ShowOnTop = true; _flashRect.Visible = false; _flashTween = new Tween(); _flashTween.Connect("tween_all_completed", this, "OnFlashTweenCompleted"); _flashRect.AddChild(_flashTween); _flashCanvas = new CanvasLayer(); _flashCanvas.AddChild(_flashRect); _camera.AddChild(_flashCanvas); AddChild(_camera); SetProcess(true); SetPhysicsProcess(true); } }