public Minigame2Element(float x, float y, float width, float height, LabelStyle questionStyle, LabelStyle remainingVotesStyle, LabelStyle resultStyle, LabelStyle alertStyle, LabelStyle situationLabelStyle, ButtonStyle buttonStyle, ButtonStyle situationButtonStyle) { bounds = new Rectangle(x, y, width, height); this.questionStyle = questionStyle; this.remainingVotesStyle = remainingVotesStyle; this.resultStyle = resultStyle; this.alertStyle = alertStyle; this.situationLabelStyle = situationLabelStyle; this.buttonStyle = buttonStyle; this.situationButtonStyle = situationButtonStyle; rootElement = new Pivot(); AddChild(rootElement); SetXY(x, y); }
public PlayerAvatarElement(float x, float y, string playerUsername, int avatarIndex, LabelStyle labelStyle, Action onClick = null, float spriteSize = 128f) : base(Mathf.Ceiling(spriteSize), Mathf.Ceiling(spriteSize) * 2) { bounds = new Rectangle(x, y, spriteSize, spriteSize * 2f); this.playerUsername = playerUsername; this.onClick += onClick; this.labelStyle = labelStyle; var playerAvatarPath = "data/sprites/avatars/"; if (avatarIndex < 5) { playerAvatarPath += $"female_{avatarIndex + 1}_"; } else { playerAvatarPath += $"male_{avatarIndex - 4}_"; } if (Math.Abs(spriteSize - 128f) < 0.00001f) { playerAvatarPath += "128.png"; } else { playerAvatarPath += "64.png"; } playerAvatar = new game.Sprite(playerAvatarPath, true, false); SetXY(x, y); Draw(); }
public Label(float x, float y, string labelText, LabelStyle labelStyle) : this(x, y, Globals.WIDTH, Globals.HEIGHT, labelText, labelStyle) { }
public Minigame3Element(float x, float y, float width, float height, LabelStyle questionStyle, LabelStyle remainingVotesStyle, LabelStyle playerNameStyle, LabelStyle alertStyle, LabelStyle choiceLabelStyle, ButtonStyle buttonStyle, ButtonStyle choiceButtonStyle) { bounds = new Rectangle(x, y, width, height); this.questionStyle = questionStyle; this.remainingVotesStyle = remainingVotesStyle; this.playerNameStyle = playerNameStyle; this.alertStyle = alertStyle; this.choiceLabelStyle = choiceLabelStyle; this.buttonStyle = buttonStyle; this.choiceButtonStyle = choiceButtonStyle; rootElement = new Pivot(); AddChild(rootElement); SetXY(x, y); }