public void GenerateStars() { Texture2D tex = Raylib.LoadTexture("assets/star.png"); for (int i = 0; i < stars.Length; i++) { stars[i] = new CenteredTexture(GetStarPos(), tex); starColors[i] = (Color)GetRandomObject(plutoColors); } }
public override void Start() { int width = pluto.width; int height = pluto.height; // stars stars = new CenteredTexture[25]; starColors = new Color[stars.Length]; GenerateStars(); // fonts fontData = new FontData(Raylib.LoadFont("assets/Square.ttf"), 18f); timeFontData = new FontData(fontData.font, 24); // pluto image symbol = new CenteredTexture(new Vector2(width / 2, height / 2), Raylib.LoadTexture("assets/pluto.png")); // header bar header = new CenteredRectangle(new Vector2(width / 2, 15), new Vector2(width, 30)); volumeSlider = new CenteredRectangle(new Vector2(header.position.X + 275, header.position.Y), new Vector2(100, 10)); brightnessSlider = new CenteredRectangle(new Vector2(header.position.X - 275, header.position.Y), new Vector2(100, 10)); // handles volumeHandle = new Circle(new Vector2(volumeSlider.literalPosition.X, volumeSlider.position.Y), 8f); brightnessHandle = new Circle(new Vector2(brightnessSlider.literalPosition.X, brightnessSlider.position.Y), 8f); // panels brightnessPanel = new CenteredRectangle(new Vector2(width / 2, height / 2), new Vector2(width, height)); mainPanel = new CenteredRectangle(new Vector2(width / 2, height / 2 + 15), new Vector2(width, height - 30)); // text objects timeText = new CenteredText(header.position, timeFontData, Color.WHITE, "TI:ME"); for (int i = 0; i < consoleText.Length; i++) { consoleText[i] = new TextObject(new Vector2(10, 35 + (i * 20)), fontData, Color.WHITE); } UpdateVolumeSlider(pluto.musicSystem.volume); brightnessHandle.position = new Vector2(GetRelativePosition(brightnessSlider.literalPosition.X, brightnessSlider.literalPosition.X + brightnessSlider.size.X, 0.99f), volumeHandle.position.Y); }