Přidány sprity pro kancelář a monitor. Graficky viditelné zavírání a otevírání dveří, zapínání a vypínání monitoru. Podpora pouze pro specifická rozlišení.

This commit is contained in:
Perry 2026-01-26 09:39:17 +01:00
parent 952aae10de
commit 2cd215cc33
13 changed files with 202 additions and 41 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using FNAF_Clone.GUI;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@ -9,13 +10,11 @@ using MonoGameLibrary.Input;
namespace FNAF_Clone;
public class GameMain() : Core("fnafkooo", 640, 360, false) {
public class GameMain() : Core("fnafkooo", 1920, 1080, false) {
// private GraphicsDeviceManager _graphics;
// private SpriteBatch _spriteBatch;
private Screen officeScreen = new(Screen.ScreenType.OFFICE);
private TextureAtlas testAtlas;
protected override void Initialize() {
Client.Connect("127.0.0.1", 9012);
@ -23,19 +22,14 @@ public class GameMain() : Core("fnafkooo", 640, 360, false) {
InputManager.AddListener(InputManager.MouseButton.LEFT, (() => Console.WriteLine("LMB pressed at: " + InputManager.MouseState.Position)), InputTiming.PRESS, new InputListenerHook(true));
base.Initialize();
UIManager.InitUI();
}
protected override void LoadContent() {
// spriteBatch = new SpriteBatch(GraphicsDevice);
testAtlas = TextureAtlas.FromFile(content, "images/testBlocks-definition.xml");
Screen.AddScreen("office", officeScreen, true);
officeScreen.AddElement("test",
new UIElement(testAtlas[0], Point.Zero)
{Pressable = true, OnMousePress = () => Console.WriteLine("Pressed!")}
);
}
protected override void Update(GameTime gameTime) {
@ -52,8 +46,8 @@ public class GameMain() : Core("fnafkooo", 640, 360, false) {
}
protected override void Draw(GameTime gameTime) {
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
GraphicsDevice.Clear(Color.Black);
spriteBatch.Begin(samplerState:SamplerState.PointClamp);
Screen.CurrentScreen.Draw(spriteBatch);