public GameScreen_MenuScreen(MotorkiGame game) { this.game = game; oResult = null; iResult = MenuReturnCodes.Error; OnExit = null; }
/// <param name="motorID">index in gameMotors table of the leading bike for UI</param> public GameScreen_GameUI(MotorkiGame game, int motorID, int width, int height) : base(game) { this.motorID = motorID; this.width = width; this.height = height; }
public UILabel(MotorkiGame game) : base(game) { ControlType = UIControlType.UILabel; AutoSize = true; fontColor = Color.Black; }
public UIButton(MotorkiGame game) : base(game) { ControlType = UIControlType.UIButton; State = UIButtonState.Normal; Action = null; InputEvents.MouseMoved += InputEvents_MouseMoved; InputEvents.MouseLeftChanged += InputEvents_MouseLeftChanged; }
public UIKeyPicker(MotorkiGame game) : base(game) { ControlType = UIControlType.UIKeyPicker; State = UIKeyPickerState.Normal; KeyChanged = null; InputEvents.KeyPressed += InputEvents_KeyPressed; InputEvents.MouseMoved += InputEvents_MouseMoved; InputEvents.MouseLeftChanged += InputEvents_MouseLeftChanged; }
public UIParent(MotorkiGame game) { if (UI != null) throw new UIParentExistsException(); UI = this; this.game = game; drawRequests = new List<UIDrawRequest>(); InputEvents.KeyPressed += InputEvents_KeyPressed; defaultTextures = game.Content.Load<Texture2D>("UIdefaulttextures"); defaultFont = game.Content.Load<SpriteFont>("UIdefaultfont"); ESCHook = null; }
public UICheckBox(MotorkiGame game) : base(game) { ControlType = UIControlType.UICheckBox; button = new UIButton(game); label = new UILabel(game); CheckChanged = null; check = false; button.Action += (UIButton_Action)((btn) => { Checked = !Checked; }); }
public UIScrollBar(MotorkiGame game, bool vertical = true) : base(game) { ControlType = UIControlType.UIScrollBar; orientation = vertical; btnMinus = new UIScrollBarButton(game, this, false); btnPlus = new UIScrollBarButton(game, this, true); thumb = new UIScrollBarThumb(game, this); ValueChanged = null; PositionAndSize = new Rectangle(0, 0, 0, 0); InputEvents.MouseMoved += InputEvents_MouseMoved; InputEvents.MouseLeftChanged += InputEvents_MouseLeftChangedOrRepeat; InputEvents.MouseLeftRepeat += InputEvents_MouseLeftChangedOrRepeat; }
public BotMotor(MotorkiGame game, Color motorColor) : base(game, motorColor, new Color(255 - motorColor.R, 255 - motorColor.G, 255 - motorColor.B)) { int a = MotorkiGame.random.Next(1000); for (int i = 0; i < a * 1000; i++) a = (a + a - a) * a / a; cmd = new int[2]; //0 - forward/backward, 1 - left/right cmd_time = new int[2]; cmd_time[0] = 0; cmd_time[1] = 0; sophistication = BotSophistication.Easy; }
public BotMotor(MotorkiGame game, Color motorColor, BotSophistication sophistication = BotSophistication.Easy) : base(game, motorColor, new Color(255 - motorColor.R, 255 - motorColor.G, 255 - motorColor.B)) { //do some randomization int a = MotorkiGame.random.Next(1000); for (int i = 0; i < a * 1000; i++) a = (a + a - a) * a / a; cmd = new int[2]; //0 - brakes active/inactive, 1 - forward/left/right cmd_time = new int[2]; cmd_time[0] = 0; cmd_time[1] = 0; this.sophistication = sophistication; }
public UITextBox(MotorkiGame game) : base(game) { ControlType = UIControlType.UITextBox; Text = ""; PasswordChar = '\0'; TextLenghtLimit = -1; CursorPos = -1; FirstVisibleChar = 0; Hilited = false; lastMouseOver = false; InputEvents.MouseMoved += InputEvents_MouseMoved; InputEvents.MouseLeftChanged += InputEvents_MouseLeftChanged; InputEvents.KeyPressed += InputEvents_KeyPressedOrRepeated; InputEvents.KeyRepeated += InputEvents_KeyPressedOrRepeated; }
/// <summary> /// loads map parameters from file /// </summary> public Map(MotorkiGame game, string filename) { this.game = game; Parameters = new MapParameters(filename); Points = new List<MapPoint>(); Edges = new List<MapEdge>(); SpawnPoints = new List<MapSpawnPoint>(); SpawnInUse = new List<bool>(); Sectors = new List<MapSector>(); Rects = new List<MapRect>(); Slices = new MapSlice[(int)(Parameters.Size.X / Parameters.Slicing.X + (Parameters.Size.X % Parameters.Slicing.X != 0.0f ? 1.0f : 0.0f)), (int)(Parameters.Size.Y / Parameters.Slicing.Y + (Parameters.Size.Y % Parameters.Slicing.Y != 0.0f ? 1.0f : 0.0f))]; for (int x = 0; x < Slices.GetLength(0); x++) for (int y = 0; y < Slices.GetLength(1); y++) Slices[x, y] = null; }
public GameScreen_Main(MotorkiGame game) : base(game) { }
private bool plusButton; //true - plus button, false - minus button #endregion Fields #region Constructors public UIScrollBarButton(MotorkiGame game, UIScrollBar parent, bool plusButton) : base(game) { ControlType = UIControlType.UIScrollBarButton; Parent = parent; State = UIButtonState.Normal; IsPlusButton = plusButton; }
/// <param name="iPlayerID">0 - player, -1 - empty slot for network player</param> /// <param name="framingRect">map limits</param> public PlayerMotor(MotorkiGame game, int iPlayerID, Color motorColor) : base(game, motorColor, new Color(255 - motorColor.R, 255 - motorColor.G, 255 - motorColor.B)) { this.iPlayerID = iPlayerID; }
public MapSlice(MotorkiGame game, Rectangle posandsize) { PositionAndSize = posandsize; picture = new RenderTarget2D(game.GraphicsDevice, PositionAndSize.Width, PositionAndSize.Height, false, SurfaceFormat.Color, DepthFormat.None, 1, RenderTargetUsage.PreserveContents); }
public UIScrollBarThumb(MotorkiGame game, UIScrollBar parent) : base(game) { ControlType = UIControlType.UIScrollBarThumb; Parent = parent; State = UIButtonState.Normal; }
public UIImage(MotorkiGame game) : base(game) { ControlType = UIControlType.UIImage; }
public GameScreen_JoinGame(MotorkiGame game) : base(game) { }
public UIProgress(MotorkiGame game) : base(game) { ControlType = UIControlType.UIProgress; percent = 0; }
/// <param name="subscreen">0 - game settings, 1 - game slots settings</param> public GameScreen_NewGame(MotorkiGame game, int subscreen = 0) : base(game) { this.subscreen = subscreen; }
/// <param name="subscreen">values: -1 - main, 0 - player, 1 - video, 2 - audio, 3 - common</param> public GameScreen_Options(MotorkiGame game, int subscreen = -1) : base(game) { this.subscreen = subscreen; }
public UIControl(MotorkiGame game) { this.game = game; if (UIParent.UI == null) throw new UIParentNotExistsException(); ControlType = UIControlType.UIControl; isLoaded = false; enabled = true; visible = true; name = ""; text = ""; layerDepth = 1; PosAndSize = new Rectangle(0, 0, 0, 0); }