public MapSelection(GraphicsDevice device, string mapName, int index, int width, int height, int startX, int startY) { this.MapName = mapName; ColouredButtonParams buttonParms = new ColouredButtonParams(); buttonParms.Font = ResourceManager.getInstance().Font; buttonParms.Height = height; buttonParms.LinesTexture = ResourceManager.getInstance().ButtonLineTexture; buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR; buttonParms.RegularColour = ResourceManager.TEXT_COLOUR; buttonParms.StartX = startX; buttonParms.Width = width; buttonParms.StartY = startY - ((index + 1) * height + (17 * (index + 1))); buttonParms.Text = mapName; buttonParms.TextsPosition = new Vector2(startX + (width / 2 - 30), buttonParms.StartY - 2f); this.PreviewButton = new ColouredButton(buttonParms); // title StaticDrawable2DParams staticParms = new StaticDrawable2DParams(); staticParms.Position = new Vector2(20f, 100f); staticParms.Texture = LoadingUtils.loadTexture2D(device, ResourceManager.MAP_FOLDER + mapName + ".png"); staticParms.Scale = new Vector2(.8f, .8f); this.previewImage = new StaticDrawable2D(staticParms); }
public Sun(ContentManager content) { StaticDrawable2DParams parms = new StaticDrawable2DParams(); Texture2D sunTx = LoadingUtils.load <Texture2D>(content, "SunLayer1"); parms.Texture = sunTx; parms.Scale = new Vector2(START_SCALE, START_SCALE); parms.Origin = new Vector2(48f, 48f); parms.Position = new Vector2(70f, 70f); this.innerLayer = new StaticDrawable2D(parms); parms.Texture = LoadingUtils.load <Texture2D>(content, "SunLayer2"); this.outterLayer = new StaticDrawable2D(parms); PulseEffectParams effectParms = new PulseEffectParams { Reference = this.outterLayer, ScaleBy = .25f, ScaleDownTo = START_SCALE, ScaleUpTo = END_SCALE }; this.outterLayer.addEffect(new PulseEffect(effectParms)); #if WINDOWS #if DEBUG if (this.innerLayer != null) { ScriptManager.getInstance().registerObject(this.innerLayer, "sunInner"); } if (this.outterLayer != null) { ScriptManager.getInstance().registerObject(this.outterLayer, "sunOutter"); } #endif #endif }
public BackGround(ContentManager content) { StaticDrawable2DParams backGroundParms = new StaticDrawable2DParams(); backGroundParms.Position = new Vector2(0f, Constants.HUD_OFFSET); backGroundParms.Texture = LoadingUtils.load <Texture2D>(content, "BackGround1"); backGroundParms.LightColour = COLOUR; this.backGround = new StaticDrawable2D(backGroundParms); this.grassBlades = new List <StaticDrawable2D>(); Texture2D grass1Texture = LoadingUtils.load <Texture2D>(content, "Grass1"); StaticDrawable2DParams grassParms = new StaticDrawable2DParams(); grassParms.Texture = grass1Texture; List <Point> usedIndexes = new List <Point>(); Point point; Random rand = new Random(); for (int i = 0; i < GRASS_BLADES; i++) { point = new Point(rand.Next(Constants.MAX_X_TILES), rand.Next(Constants.MAX_Y_TILES)); if (usedIndexes.Contains(point)) { i--; continue; } else { usedIndexes.Add(point); grassParms.Position = new Vector2(point.X * Constants.TILE_SIZE, (point.Y * Constants.TILE_SIZE) + Constants.HUD_OFFSET); this.grassBlades.Add(new StaticDrawable2D(grassParms)); } } }
/// <summary> /// Constructs a CheckBox object based on the params /// </summary> /// <param name="parms">CheckBoxParams object</param> public CheckBox(CheckBoxParams parms) : base(parms) { this.Checked = parms.Checked; StaticDrawable2DParams imgParms = new StaticDrawable2DParams { Position = parms.Position, LightColour = parms.LightColour, Scale = parms.Scale, RenderingRectangle = Constants.CHK_BOX_UNCHECKED, Texture = LoadingUtils.load <Texture2D>(parms.Content, Constants.GUI_FILE_NAME), Origin = new Vector2(Constants.CHK_BOX_UNCHECKED.Width / 2, Constants.CHK_BOX_UNCHECKED.Height / 2) }; this.uncheckedBoxImag = new StaticDrawable2D(imgParms); Vector3 min = new Vector3(parms.Position.X - Constants.CHK_BOX_CHECKED.Width / 2, parms.Position.Y - Constants.CHK_BOX_CHECKED.Height / 2, 0f); Vector3 max = new Vector3(parms.Position.X + Constants.CHK_BOX_CHECKED.Width / 2, parms.Position.Y + Constants.CHK_BOX_CHECKED.Height / 2, 0f); this.bbox = new BoundingBox(min, max); imgParms.RenderingRectangle = Constants.CHK_BOX_CHECKED; this.checkedBoxImag = new StaticDrawable2D(imgParms); Text2DParams textParms = new Text2DParams { Position = new Vector2(parms.Position.X + 40f, parms.Position.Y), LightColour = parms.LightColour, WrittenText = parms.Text, Scale = parms.Scale, Font = parms.Font, Origin = new Vector2(Constants.CHK_BOX_UNCHECKED.Width / 2, Constants.CHK_BOX_UNCHECKED.Height / 2) }; this.text = new Text2D(textParms); }
public Ghost(ContentManager content, Vector2 position, GhostObservationHandler observerHandler, CharactersInRange charactersInRange, OnDeath onDeath, float health = Constants.DEFAULT_HEALTH) : base(content, position, SPEED, charactersInRange, onDeath, health) { this.observerHandler = observerHandler; Texture2D texture = LoadingUtils.load <Texture2D>(content, "Ghost"); StaticDrawable2DParams characterParms = new StaticDrawable2DParams { Position = position, Texture = texture, Origin = new Vector2(Constants.TILE_SIZE / 2) }; base.init(new StaticDrawable2D(characterParms)); Texture2D radiusTexture = LoadingUtils.load <Texture2D>(content, "Ring"); StaticDrawable2DParams parms = new StaticDrawable2DParams(); parms.Position = position; parms.LightColour = Color.LimeGreen; parms.Texture = radiusTexture; parms.Origin = new Vector2(Constants.TILE_SIZE / 2, -(Constants.TILE_SIZE / 4)); this.selectedImg = new StaticDrawable2D(parms); this.seeking = new Tracking(position, SPEED); this.fadeEffect = createEffect(base.LightColour); this.addEffect(fadeEffect); this.selectedFadeEffect = createEffect(this.selectedImg.LightColour); initSkills(); }
/// <summary> /// Constructs a Slider object based on the params object /// </summary> /// <param name="parms">SliderParams object</param> public Slider(SliderParams parms) : base(parms) { this.CurrentValue = parms.CurrentValue; this.initialX = parms.Position.X; Texture2D texture = LoadingUtils.load <Texture2D>(parms.Content, Constants.GUI_FILE_NAME); StaticDrawable2DParams imgParms = new StaticDrawable2DParams { Position = parms.Position, LightColour = parms.BarColour, Scale = parms.Scale, RenderingRectangle = Constants.SLIDER_BAR, Texture = texture, Origin = new Vector2(Constants.SLIDER_BAR.Width / 2, Constants.SLIDER_BAR.Height / 2) }; this.bar = new StaticDrawable2D(imgParms); imgParms.Scale = parms.BallScale; imgParms.LightColour = parms.BallColour; imgParms.RenderingRectangle = Constants.SLIDER_BALL; imgParms.Origin = new Vector2(Constants.SLIDER_BALL.Width / 2, Constants.SLIDER_BALL.Height / 2); this.ball = new StaticDrawable2D(imgParms); setPosition(); Text2DParams textParms = new Text2DParams { Position = new Vector2(parms.Position.X + 100f, parms.Position.Y), LightColour = parms.LightColour, WrittenText = getValue(), Font = parms.Font, Origin = new Vector2(16f, 16f), }; this.text = new Text2D(textParms); }
public InstructionsMenu(ContentManager content) { ColouredButtonParams buttonParms = new ColouredButtonParams(); buttonParms.Font = ResourceManager.getInstance().Font; buttonParms.Height = 25; buttonParms.LinesTexture = ResourceManager.getInstance().ButtonLineTexture; buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR; buttonParms.RegularColour = ResourceManager.TEXT_COLOUR; buttonParms.StartX = 560; buttonParms.Width = 225; // return button buttonParms.StartY = 557; buttonParms.Text = "Return To Main Menu"; buttonParms.TextsPosition = new Vector2(570f, buttonParms.StartY - 2); this.returnToMainButton = new ColouredButton(buttonParms); // title StaticDrawable2DParams staticParms = new StaticDrawable2DParams(); staticParms.Position = new Vector2(0f, 0f); staticParms.Texture = LoadingUtils.load <Texture2D>(content, "Instructions"); this.title = new StaticDrawable2D(staticParms); // background staticParms.Position = new Vector2(80f, 25f); staticParms.Texture = LoadingUtils.load <Texture2D>(content, "HowToPlay"); this.backGround = new StaticDrawable2D(staticParms); // sound effects this.outroSfx = LoadingUtils.load <SoundEffect>(content, "WhereWeGonnaRob"); }
public OptionsSection(ContentManager content, Vector2 position, float bindersX, string sectionName, Controls controls) { SpriteFont font = LoadingUtils.load <SpriteFont>(content, "SpriteFont1"); Text2DParams parms = new Text2DParams { Font = font, LightColour = Color.Red, Position = position, WrittenText = "Player " + sectionName + "'s Key Bindings", }; this.heading = new Text2D(parms); Vector2 textPosition = new Vector2(position.X, position.Y + SPACE); Vector2 bindersPosition = new Vector2(bindersX, textPosition.Y); this.bindings = new Dictionary <string, KeyBinding>(); this.bindings.Add(BINDING_NAMES[0], new KeyBinding(font, content, textPosition, bindersPosition, BINDING_NAMES[0], controls.Left)); getPositions(ref textPosition, ref bindersPosition); this.bindings.Add(BINDING_NAMES[1], new KeyBinding(font, content, textPosition, bindersPosition, BINDING_NAMES[1], controls.Up)); getPositions(ref textPosition, ref bindersPosition); this.bindings.Add(BINDING_NAMES[2], new KeyBinding(font, content, textPosition, bindersPosition, BINDING_NAMES[2], controls.Right)); getPositions(ref textPosition, ref bindersPosition); this.bindings.Add(BINDING_NAMES[3], new KeyBinding(font, content, textPosition, bindersPosition, BINDING_NAMES[3], controls.Down)); getPositions(ref textPosition, ref bindersPosition); }
public Fence(ContentManager content) { int size = 9; this.pieces = new StaticDrawable2D[size]; Texture2D fenceTexture = LoadingUtils.load <Texture2D>(content, "Fence"); StaticDrawable2DParams parms = new StaticDrawable2DParams(); parms.Texture = fenceTexture; parms.Scale = new Vector2(1f, 1.5f); int textureWidth = fenceTexture.Width; for (int i = 0; i < size; i++) { parms.Position = new Vector2(i * textureWidth, 330f); this.pieces[i] = new StaticDrawable2D(parms); } #if WINDOWS #if DEBUG if (this.pieces != null) { for (int i = 0; i < this.pieces.Length; i++) { ScriptManager.getInstance().registerObject(this.pieces[i], "fence" + i); } } #endif #endif }
public MainMenu(ContentManager content) { ColouredButtonParams buttonParms = new ColouredButtonParams(); buttonParms.Font = ResourceManager.getInstance().Font; buttonParms.Height = 25; buttonParms.LinesTexture = ResourceManager.getInstance().ButtonLineTexture; buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR; buttonParms.RegularColour = ResourceManager.TEXT_COLOUR; buttonParms.StartX = 640; buttonParms.Width = 150; // play button buttonParms.StartY = 473; buttonParms.Text = "Play"; buttonParms.TextsPosition = new Vector2(690f, buttonParms.StartY - 2f); this.playButton = new ColouredButton(buttonParms); // instructions button buttonParms.StartY = 515; buttonParms.Text = "Instructions"; buttonParms.TextsPosition = new Vector2(650f, buttonParms.StartY - 2f); this.instructionsButton = new ColouredButton(buttonParms); // exit button buttonParms.StartY = 557; buttonParms.Text = "Exit"; buttonParms.TextsPosition = new Vector2(690f, buttonParms.StartY - 2); this.exitButton = new ColouredButton(buttonParms); // title StaticDrawable2DParams staticParms = new StaticDrawable2DParams(); staticParms.Position = new Vector2(0f, -20f); staticParms.Texture = LoadingUtils.load <Texture2D>(content, "Title"); this.title = new StaticDrawable2D(staticParms); // background staticParms.Position = new Vector2(0f, 0f); staticParms.Texture = LoadingUtils.load <Texture2D>(content, "MainMenu"); this.backGround = new StaticDrawable2D(staticParms); // load sound effects this.introSfx = LoadingUtils.load <SoundEffect>(content, "Introduction"); this.outroSfx = LoadingUtils.load <SoundEffect>(content, "LetsGo"); this.idleSfxs = new SoundEffect[3]; this.idleSfxs[0] = LoadingUtils.load <SoundEffect>(content, "Rules"); this.idleSfxs[1] = LoadingUtils.load <SoundEffect>(content, "HaventGotAllDay"); this.idleSfxs[2] = LoadingUtils.load <SoundEffect>(content, "LetsRobSomething"); // tired of hearing this when debugging and not starting in this state if (StateManager.getInstance().CurrentGameState == StateManager.GameState.MainMenu) { SoundManager.getInstance().sfxEngine.playSoundEffect(this.introSfx); } #if WINDOWS #if DEBUG ScriptManager.getInstance().registerObject(((ColouredButton)this.playButton).Text, "playText"); #endif #endif }
public MainMenu(ContentManager content) : base(content, "MainMenu", new Vector2(Constants.RESOLUTION_X / 2, Constants.RESOLUTION_Y / 8 * 3)) { this.effectParms = new PulseEffectParams { ScaleBy = 1f, ScaleDownTo = .9f, ScaleUpTo = 1.1f }; this.index = 0; this.menuItems = new StaticDrawable2D[BUTTON_NAMES.Length]; Vector2 startPosition = new Vector2(Constants.RESOLUTION_X / 2, (Constants.RESOLUTION_Y / 8 * 3) + 250f); StaticDrawable2DParams parms = new StaticDrawable2DParams { Origin = new Vector2(128f), Scale = DEFAULT_SCALE, }; for (int i = 0; i < this.menuItems.Length; i++) { parms.Position = new Vector2(startPosition.X, startPosition.Y + (i * SPACE)); parms.Texture = LoadingUtils.load <Texture2D>(content, BUTTON_NAMES[i]); this.menuItems[i] = new StaticDrawable2D(parms); } this.menuItems[0].addEffect(new PulseEffect(this.effectParms)); }
public Timer(ContentManager content) { Text2DParams parms = new Text2DParams(); parms.Font = ResourceManager.getInstance().Font; parms.LightColour = ResourceManager.TEXT_COLOUR; parms.Position = new Vector2(682f, 14f); parms.WrittenText = FIRST_PART; this.firstPart = new Text2D(parms); parms.Position = new Vector2(684f, 39f); parms.WrittenText = SECOND_PART; this.secondPart = new Text2D(parms); parms.Position = new Vector2(700f, 87f); parms.WrittenText = THIRD_PART; this.thirdPart = new Text2D(parms); parms.Position = new Vector2(700f, 63f); parms.WrittenText = "0"; parms.LightColour = HIGH_TIME; this.timeText = new Text2D(parms); this.activeTimeColour = HIGH_TIME; //sfxs this.guardsAlertedSfx = LoadingUtils.load <SoundEffect>(content, DETECTED_SFX_NAME); #if WINDOWS #if DEBUG ScriptManager.getInstance().registerObject(this.firstPart, "first"); ScriptManager.getInstance().registerObject(this.secondPart, "second"); ScriptManager.getInstance().registerObject(this.timeText, "time"); ScriptManager.getInstance().registerObject(this.thirdPart, "third"); #endif #endif }
public TutorialComplete(ContentManager content) : base(content, "GeneralBackground") { VisualCallback setPrevipousState = delegate() { GameStateMachine.getInstance().goToPreviousState(); }; VisualCallback setNextState = delegate() { GameStateMachine.getInstance().LevelContext = null; GameStateMachine.getInstance().goToNextState(); }; List <ButtonRequest> requests = new List <ButtonRequest>(); requests.Add(new ButtonRequest("Menu", setPrevipousState)); requests.Add(new ButtonRequest("Torment", setNextState)); base.createButtons(requests.ToArray()); Texture2D texture = LoadingUtils.load <Texture2D>(content, "Tut_Finish"); StaticDrawable2DParams parms = new StaticDrawable2DParams { Texture = texture, Origin = new Vector2(texture.Width / 2, texture.Height / 2), Position = new Vector2(Constants.RESOLUTION_X / 2, Constants.RESOLUTION_Y / 2) }; this.image = new StaticDrawable2D(parms); }
public static TexturedEffectButton createButton(ContentManager content, Vector2 position, String name) { const float SPACE = 65f; PulseEffectParams effectParms = new PulseEffectParams { ScaleBy = 1f, ScaleDownTo = .9f, ScaleUpTo = 1.1f }; Vector2 origin = new Vector2(128f, 64f); Vector2 scale = new Vector2(1f, .5f); TexturedEffectButtonParams buttonParms = new TexturedEffectButtonParams { Position = position, Origin = origin, Scale = scale, Effects = new List <BaseEffect> { new PulseEffect(effectParms) }, PickableArea = CollisionGenerationUtils.getButtonRectangle(origin, position), ResetDelegate = delegate(StaticDrawable2D button) { button.Scale = scale; } }; buttonParms.Texture = LoadingUtils.load <Texture2D>(content, name); buttonParms.Position = new Vector2(buttonParms.Position.X, buttonParms.Position.Y + SPACE * 1.3f); buttonParms.PickableArea = CollisionGenerationUtils.getButtonRectangle(origin, buttonParms.Position); return(new TexturedEffectButton(buttonParms)); }
private void init(bool fullRegen = false) { Vector3 min = new Vector3(0, Constants.HUD_OFFSET, 0f); Vector3 max = new Vector3(Constants.RESOLUTION_X, Constants.RESOLUTION_Y, 0f); this.boundary = new BoundingBox(min, max); this.rand = new Random(); PositionGenerator.getInstance().init(this.rand); SpawnGenerator.getInstance().SpawnRequests.Clear(); if (StateManager.getInstance().GameMode == GameMode.OnePlayer) { this.playerOne = new Snake(this.content, Constants.HEADING_UP, 0f, ConfigurationManager.getInstance().PlayerOnesControls); } else { this.playerOne = new Snake(this.content, Constants.HEADING_UP, 100f, ConfigurationManager.getInstance().PlayerOnesControls); this.playerTwo = new Snake(this.content, Constants.HEADING_UP, -100f, ConfigurationManager.getInstance().PlayerTwosControls); } if (fullRegen) { this.backGround = new BackGround(this.content); this.hud = new HUD(this.content); this.foodManager = new FoodManager(content, this.rand); this.portals = new PortalManager(content, this.rand); this.walls = new WallManager(content, this.rand); } #if DEBUG this.debugLine = LoadingUtils.load <Texture2D>(this.content, "Chip"); #endif }
public Mob(ContentManager content, Vector2 position, CharactersInRange charactersInRange, OnDeath onDeath, CollisionCheck collisionCheck, String monsterName) : base(content, position, SPEED, charactersInRange, onDeath, Constants.DEFAULT_HEALTH) { StaticDrawable2D character = getCharacterSprite(content, position, monsterName); base.init(character); BehaviourFinished idleCallback = delegate() { swapBehaviours(this.idleBehaviour, State.Idle); }; BehaviourFinished restartPathing = delegate() { #if DEBUG Debug.log("Restarting"); #endif //this.activeBehaviour.Target = this.LastKnownLocation; pathToWaypoint(this.LastKnownLocation); }; this.seekingBehaviour = new Tracking(position, SPEED, idleCallback, collisionCheck); this.lostTargetBehaviour = new LostTarget(this.seekingBehaviour.Position, this.seekingBehaviour.Position, SPEED, idleCallback); this.pathingBehaviour = new Pathing(position, SPEED, idleCallback, collisionCheck, restartPathing); this.idleBehaviour = new IdleBehaviour(position); this.activeBehaviour = this.idleBehaviour; this.CurrentState = State.Idle; updateBoundingSphere(); this.previousPoint = base.Position.toPoint(); this.LastKnownLocation = base.Position; this.skills = new List <Skill>(); this.explosionSfx = LoadingUtils.load <SoundEffect>(content, "CorpseExplosion"); initSkills(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { Constants.FONT = LoadingUtils.load <SpriteFont>(Content, "SpriteFont1"); GameStateMachine.getInstance().init(GraphicsDevice, Content); SoundManager.getInstance().init(Content); this.fadeParams = new FadeEffectParams { OriginalColour = Color.Black, State = FadeEffect.FadeState.Out, TotalTransitionTime = TRANSITION_TIME }; this.fadeEffect = new FadeEffect(fadeParams); StaticDrawable2DParams transitionParms = new StaticDrawable2DParams { Texture = LoadingUtils.load <Texture2D>(Content, "Chip"), Scale = new Vector2(Constants.RESOLUTION_X, Constants.RESOLUTION_Y), LightColour = Color.Black }; this.transitionItem = new StaticDrawable2D(transitionParms); this.transitionItem.addEffect(this.fadeEffect); #if WINDOWS #if DEBUG ScriptManager.getInstance().LogFile = "Log.log"; ScriptManager.getInstance().registerObject(MapEditor.getInstance(), "editor"); Debug.debugChip = LoadingUtils.load <Texture2D>(Content, "Chip"); Debug.debugRing = TextureUtils.create2DRingTexture(GraphicsDevice, (int)Constants.BOUNDING_SPHERE_SIZE, Color.White); #endif #endif }
public Entity(ContentManager content, Base2DSpriteDrawable image, bool alwaysRender = false) { this.content = content; this.alwaysRender = alwaysRender; init(image); #if DEBUG this.debugLine = LoadingUtils.load <Texture2D>(content, "Chip"); #endif }
public GameDisplay(GraphicsDevice graphics, ContentManager content) { this.content = content; init(true); #if DEBUG radiusTexture = TextureUtils.create2DRingTexture(graphics, 100, Color.White); this.overlayTexture = LoadingUtils.load <Texture2D>(content, "Overlay"); #endif }
protected override void createIdleEmitter() { BaseParticle2DEmitterParams emitterParms = new BaseParticle2DEmitterParams(); emitterParms.ParticleTexture = LoadingUtils.load <Texture2D>(content, "Heart"); emitterParms.SpawnDelay = 150f; base.idleEmitter = new ConstantSpeedParticleEmitter(emitterParms, base.Position, new Vector2(Constants.TILE_SIZE / 2, Constants.TILE_SIZE), base.idleSFX, IDLE_SFX_EMIT_RADIUS); }
public void init(GraphicsDevice device, ContentManager content) { this.Font = LoadingUtils.load <SpriteFont>(content, "Font"); this.ButtonLineTexture = TextureUtils.create2DColouredTexture(device, 2, 2, Color.White); this.MouseOverSfx = LoadingUtils.load <SoundEffect>(content, "MouseOverButton"); #if DEBUG this.DebugChip = TextureUtils.create2DColouredTexture(device, 32, 32, Color.White); this.DebugRing = TextureUtils.create2DRingTexture(device, 112, Color.White); #endif }
public Button(ContentManager content, TexturedEffectButton button, VisualCallback setState) : base(content) { //this.staticBoundingBox = boundingBox; this.sfx = LoadingUtils.load <SoundEffect>(content, "ButtonClick"); this.setState = setState; this.TexturedButton = button; base.init(button); }
public Player(ContentManager content, SFXEngine sfxEngine, Vector2 position, NukeDelegate nukeDelegate, int ownerID) : base(content, sfxEngine, position, nukeDelegate, ownerID) { Text2DParams textParms = new Text2DParams(); textParms.Font = LoadingUtils.load <SpriteFont>(content, "SpriteFont1"); textParms.Position = new Vector2(10f); textParms.LightColour = Color.Black; this.powerText = new Text2D(textParms); }
public Item(ContentManager content, string textureName, Placement startingPlacement) { StaticDrawable2DParams parms = new StaticDrawable2DParams(); parms.Texture = LoadingUtils.load <Texture2D>(content, textureName); parms.Origin = new Vector2(ResourceManager.TILE_SIZE / 2f); parms.Position = new Vector2(startingPlacement.worldPosition.X + parms.Origin.X, startingPlacement.worldPosition.Y + parms.Origin.Y); this.image = new StaticDrawable2D(parms); this.placement = startingPlacement; }
public void loadResources(GraphicsDevice device, ContentManager content) { this.Font = LoadingUtils.load <SpriteFont>(content, "HUDFont"); this.CloudTexture1 = LoadingUtils.load <Texture2D>(content, "Cloud1"); this.CloudTexture2 = LoadingUtils.load <Texture2D>(content, "Cloud2"); this.ShrubTexture = LoadingUtils.load <Texture2D>(content, "Shrub"); this.ButtonsLineTexture = TextureUtils.create2DColouredTexture(device, 1, 1, Color.White); this.ButtonsMouseOverColour = Color.Yellow; this.TextColour = Color.White; }
protected override void createIdleEmitter() { Vector2 origin = new Vector2(Constants.TILE_SIZE, Constants.TILE_SIZE * 2); BaseParticle2DEmitterParams emitterParms = new BaseParticle2DEmitterParams(); emitterParms.ParticleTexture = LoadingUtils.load <Texture2D>(content, "Bawk"); emitterParms.SpawnDelay = 4000f; base.idleEmitter = new ConstantSpeedParticleEmitter(emitterParms, base.Position, origin, base.idleSFX, IDLE_SFX_EMIT_RADIUS, false); }
public HUDSelected(ContentManager content, Vector2 position) : base(content) { StaticDrawable2DParams parms = new StaticDrawable2DParams() { Position = position, Texture = LoadingUtils.load <Texture2D>(content, "Ghost_Grey"), Scale = new Vector2(.5f), }; base.init(new StaticDrawable2D(parms)); }
protected override void initVisuals() { base.initVisuals(); BaseParticle2DEmitterParams parms = new BaseParticle2DEmitterParams() { ParticleTexture = LoadingUtils.load <Texture2D>(content, "bloodDrop"), SpawnDelay = 0f }; emitters.Add(new BloodEmitter(parms, position)); }
public BaseMenu(ContentManager content, string backgroundName, Vector2 position) { Texture2D texture = LoadingUtils.load <Texture2D>(content, backgroundName); StaticDrawable2DParams parms = new StaticDrawable2DParams { Texture = texture, Origin = new Vector2(texture.Width / 2, texture.Height / 2), Position = position }; this.background = new StaticDrawable2D(parms); }
public Cinematic(ContentManager content) { Texture2D texture = LoadingUtils.load <Texture2D>(content, "Logo"); StaticDrawable2DParams parms = new StaticDrawable2DParams { Texture = texture, Origin = new Vector2(texture.Width / 2, texture.Height / 2), Position = new Vector2(Constants.RESOLUTION_X / 2, Constants.RESOLUTION_Y / 2) }; this.cinematic = new StaticDrawable2D(parms); }