public SetAnchor ( Vector2 newAnchor ) : void | ||
newAnchor | Vector2 | |
Résultat | void |
public LevelBar(int numDashes) { this.numDashes = numDashes; string borderElementName = "UI/Stats/LevelBar_" + numDashes; if (numDashes == 5) { dashWidth = 19; } else if (numDashes == 10) { dashWidth = 9; } else if (numDashes == 25) { dashWidth = 3; } AddChild (barContainer = new FContainer ()); barContainer.AddChild (background = new FSprite ("Box")); //black bg background.color = Color.black; background.SetAnchor (0.0f, 0.0f); barContainer.AddChild (borderSprite = new FSprite (borderElementName));//white border borderSprite.SetAnchor (0.0f, 0); borderSprite.SetPosition (0, 0); barContainer.AddChild (dashContainer = new FContainer ()); dashSpacing = 1; totalWidth = 100; dashHeight = 3; barOffset = new Vector2 (-51, 0); dashOffset = new Vector2 (1, 2); ApplyConfig (); }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------ private void setupLighting() { // define the shader and reuse this shader on the sprites so the FRenderLayers continue to batch properly // SRLightingShader(string normalTexture, float shininess, Color diffuseColor, Color specularColor) SRLightingShader lightingShader = new SRLightingShader(ROCKS_NORMAL, 2.5f, Color.white, Color.white); // sprite uses the SRLightingShader for normal mapped lighting FSprite leftRockSprite = new FSprite(ROCKS_SPRITE); leftRockSprite.shader = lightingShader; // do NOT create a new Shader for each sprite. Doing so would break FRenderLayer batching leftRockSprite.SetAnchor(1.0f, 0.5f); Futile.stage.AddChild(leftRockSprite); // sprite uses the SRLightingShader for normal mapped lighting FSprite rightRockSprite = new FSprite(ROCKS_SPRITE); rightRockSprite.shader = lightingShader; // do NOT create a new Shader for each sprite. Doing so would break FRenderLayer batching rightRockSprite.SetAnchor(0.0f, 0.5f); Futile.stage.AddChild(rightRockSprite); // add light gameobject lightGameObject = new GameObject("Light"); lightGameObject.transform.localPosition = new Vector3(0, 0, lightDepth); // add lightsource to it and configure lightSource = lightGameObject.AddComponent <Light>(); lightSource.color = Color.white; lightSource.intensity = 8; lightSource.range = 375; lightSource.type = LightType.Point; lightSource.renderMode = LightRenderMode.ForcePixel; // ForcePixel = Important }
public override void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); string backButtonText = "Back"; string titleText = "About The Game"; if (Main.instance.gameFinished){ // Display end game messages titleText = "The Ship Went Nuclear!"; _scoreLabel = new FLabel("Emulogic", "You Saved " + Main.instance.crewSaved + " Crew Members"); _scoreLabel.color = Color.black; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _scoreLabel.scale = 0.25f; _scoreLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight / 2); AddChild(_scoreLabel); _againButton = new FButton("buttonWide"); _againButton.AddLabel("Emulogic","Play Again",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _againButton.label.scale = 0.25f; _againButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + 80); AddChild(_againButton); _againButton.SignalRelease += HandleAgainButtonRelease; backButtonText = "Home"; } else { // diplay generic message } _textLabel = new FLabel("Emulogic", titleText); _textLabel.color = Color.black; _textLabel.scale = 0.5f; _textLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight * 2 / 3); AddChild(_textLabel); _quitButton = new FButton("buttonWide"); _quitButton.AddLabel("Emulogic",backButtonText,Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _quitButton.label.scale = 0.25f; _quitButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight); AddChild(_quitButton); _quitButton.SignalRelease += HandleQuitButtonRelease; string about = "Game Designed and created by Jason Rendel,\nfor Ludum Dare 27. My first game jam ever!\nCreated for the 48 hour competition.\n\n ---- Tools ----\n Unity 3d - Futile - Gimp \nTexture Packer - Glyph Designer - CFXR\n\nFollow me @jasonrendel\nCheck out what else I'm up to at www.jasonrendel.com"; _scoreLabel = new FLabel("Emulogic", about); _scoreLabel.color = Color.black; _scoreLabel.scale = 0.20f; _scoreLabel.SetPosition(Futile.screen.halfWidth, 200); AddChild(_scoreLabel); }
override public void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; Main.instance.crewSaved = 0; FSprite background = new FSprite("mainGameViewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _levelManager = new LevelManager(); AddChild(_levelManager); this.shouldSortByZ = true; meltdownBar = new FSprite("meltdown"); meltdownBar.SetPosition(Futile.screen.halfWidth, 672); AddChild(meltdownBar); _closeButton = new FButton("button"); _closeButton.AddLabel("Emulogic", "Quit", Color.black); _closeButton.label.scale = 0.25f; _closeButton.sortZ = 1; _closeButton.SignalRelease += HandleCloseButtonRelease; _closeButton.x = Futile.screen.width - 125.0f; _closeButton.y = Futile.screen.height - 75.0f; AddChild(_closeButton); Clock clock = new Clock(); clock.SetPosition(75.0f, Futile.screen.height - 75.0f); AddChild(clock); crewSavedLabel = new FLabel("Emulogic", "Crew Members Saved: 0"); crewSavedLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.height - 45.0f); crewSavedLabel.scale = 0.25f; AddChild(crewSavedLabel); selectedInventory = new FSprite("inventorySelected"); selectedInventory.isVisible = false; AddChild(selectedInventory); //spawnInventory(); spawnCrew(2); _lastCycle = Main.GameTime; }
public VirtualControlButton( InputControlType controlType, string elementName, Vector2 position ) { this.controlType = controlType; value = 0.0f; touchId = -1; alpha = 0.5f; sprite = new FSprite( elementName ); sprite.SetAnchor( new Vector2( 0.5f, 0.5f ) ); AddChild( sprite ); SetPosition( position ); }
public VirtualControlButton(InputControlType controlType, string elementName, Vector2 position) { this.controlType = controlType; value = 0.0f; touchId = -1; alpha = 0.5f; sprite = new FSprite(elementName); sprite.SetAnchor(new Vector2(0.5f, 0.5f)); AddChild(sprite); SetPosition(position); }
public void SetupDashes(List <DashData> dashDatas) { for (int d = 0; d < dashDatas.Count; d++) { FSprite dash = new FSprite("Box"); dash.SetAnchor(0, 0); dash.width = dashWidth; dash.height = dashHeight; dash.x = dashOffset.x + d * (dashWidth + dashSpacing); dash.y = dashOffset.y; dash.color = dashDatas[d].color; dashes.Add(dash); dashContainer.AddChild(dash); } }
public FContainer DrawLayer(int id) { FContainer cont = new FContainer(); for(int row = 0;row < _layers[id]._height; row++) { for(int column = 0;column < _layers[id]._width; column++) { int sid = _layers[id]._data[(row*_layers[id]._width)+column]; if(sid!=0){ FSprite s = new FSprite(_tileset[0]._elements[sid-1]); s.SetAnchor(0, 1); s.x = column*32; s.y = -row*32; cont.AddChild(s); } } } return cont; }
public FDebugFrameRateGraph() : base() { _texWidth = BASE_TEX_WIDTH; _texHeight = BASE_TEX_HEIGHT; _numPixels = _texWidth * _texHeight; _newFramePixels = new Color[_texHeight]; _graphTex = new Texture2D(_texWidth, _texHeight, TextureFormat.ARGB32, false); _graphTex.filterMode = FilterMode.Point; // Initialize the graph Color[] blank = new Color[_numPixels]; for (int i = 0; i < _numPixels; i++) { blank[i] = _blank; } _graphTex.SetPixels(blank); // Draw lines for the target frame rate _targetRow = Mathf.FloorToInt(IDEAL_FRAME_TIME / (MAX_FRAME_TIME / (float)_texHeight)); _doubleTargetRow = Mathf.FloorToInt(2.0f * IDEAL_FRAME_TIME / (MAX_FRAME_TIME / (float)_texHeight)); Color[] targetColor = new Color[_texWidth]; Color[] doubleTargetColor = new Color[_texWidth]; Color[] maxTargetColor = new Color[_texWidth]; for (int i = 0; i < _texWidth; i++) { targetColor[i] = Color.black; doubleTargetColor[i] = Color.black; maxTargetColor[i] = Color.black; } _graphTex.SetPixels(0, _targetRow, _texWidth, 1, targetColor); _graphTex.SetPixels(0, _doubleTargetRow, _texWidth, 1, doubleTargetColor); _graphTex.SetPixels(0, _texHeight - 1, _texWidth, 1, maxTargetColor); _graphTex.Apply(); Futile.atlasManager.LoadAtlasFromTexture("debugFrameGraph", _graphTex); _graphSprite = new FSprite("debugFrameGraph"); _graphSprite.SetAnchor(0.0f, 0.0f); _graphSprite.scale = Futile.resourceScale; AddChild(_graphSprite); ListenForUpdate(HandleUpdate); }
public FDebugFrameRateGraph() : base() { _texWidth = BASE_TEX_WIDTH; _texHeight = BASE_TEX_HEIGHT; _numPixels = _texWidth * _texHeight; _newFramePixels = new Color[_texHeight]; _graphTex = new Texture2D(_texWidth, _texHeight, TextureFormat.ARGB32, false); _graphTex.filterMode = FilterMode.Point; // Initialize the graph Color[] blank = new Color[_numPixels]; for (int i = 0; i < _numPixels; i++) { blank[i] = _blank; } _graphTex.SetPixels(blank); // Draw lines for the target frame rate _targetRow = Mathf.FloorToInt(IDEAL_FRAME_TIME / (MAX_FRAME_TIME / _texHeight)); _doubleTargetRow = Mathf.FloorToInt(2.0f * IDEAL_FRAME_TIME / (MAX_FRAME_TIME / _texHeight)); Color[] targetColor = new Color[_texWidth]; Color[] doubleTargetColor = new Color[_texWidth]; Color[] maxTargetColor = new Color[_texWidth]; for (int i = 0; i < _texWidth; i++) { targetColor[i] = Color.black; doubleTargetColor[i] = Color.black; maxTargetColor[i] = Color.black; } _graphTex.SetPixels(0, _targetRow, _texWidth, 1, targetColor); _graphTex.SetPixels(0, _doubleTargetRow, _texWidth, 1, doubleTargetColor); _graphTex.SetPixels(0, _texHeight - 1, _texWidth, 1, maxTargetColor); _graphTex.Apply(); Futile.atlasManager.LoadAtlasFromTexture("debugFrameGraph", _graphTex); _graphSprite = new FSprite("debugFrameGraph"); _graphSprite.SetAnchor(0.0f, 0.0f); _graphSprite.scale = Futile.resourceScale; AddChild(_graphSprite); ListenForUpdate(HandleUpdate); }
public VirtualControlStick( InputControlType xAxis, InputControlType yAxis ) { this.xAxis = xAxis; this.yAxis = yAxis; delta = Vector2.zero; value = Vector2.zero; touchId = -1; alpha = 0.5f; baseSprite = new FSprite( "VirtualInput/StickBase" ); baseSprite.SetAnchor( new Vector2( 0.5f, 0.5f ) ); AddChild( baseSprite ); headSprite = new FSprite( "VirtualInput/StickHead" ); headSprite.SetAnchor( new Vector2( 0.5f, 0.5f ) ); AddChild( headSprite ); SetPosition( -Futile.screen.halfWidth + 96, -Futile.screen.halfHeight + 96 ); }
public VirtualControlStick(InputControlType xAxis, InputControlType yAxis) { this.xAxis = xAxis; this.yAxis = yAxis; delta = Vector2.zero; value = Vector2.zero; touchId = -1; alpha = 0.5f; baseSprite = new FSprite("VirtualInput/StickBase"); baseSprite.SetAnchor(new Vector2(0.5f, 0.5f)); AddChild(baseSprite); headSprite = new FSprite("VirtualInput/StickHead"); headSprite.SetAnchor(new Vector2(0.5f, 0.5f)); AddChild(headSprite); SetPosition(-Futile.screen.halfWidth + 96, -Futile.screen.halfHeight + 96); }
public LevelBar(int numDashes) { this.numDashes = numDashes; string borderElementName = "UI/Stats/LevelBar_" + numDashes; if (numDashes == 5) { dashWidth = 19; } else if (numDashes == 10) { dashWidth = 9; } else if (numDashes == 25) { dashWidth = 3; } AddChild(barContainer = new FContainer()); barContainer.AddChild(background = new FSprite("Box")); //black bg background.color = Color.black; background.SetAnchor(0.0f, 0.0f); barContainer.AddChild(borderSprite = new FSprite(borderElementName)); //white border borderSprite.SetAnchor(0.0f, 0); borderSprite.SetPosition(0, 0); barContainer.AddChild(dashContainer = new FContainer()); dashSpacing = 1; totalWidth = 100; dashHeight = 3; barOffset = new Vector2(-51, 0); dashOffset = new Vector2(1, 2); ApplyConfig(); }
public override void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; Main.instance.crewSaved = 0; FSprite background = new FSprite("mainGameViewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _levelManager = new LevelManager(); AddChild(_levelManager); this.shouldSortByZ = true; meltdownBar = new FSprite("meltdown"); meltdownBar.SetPosition(Futile.screen.halfWidth, 672); AddChild(meltdownBar); _closeButton = new FButton("button"); _closeButton.AddLabel("Emulogic","Quit",Color.black); _closeButton.label.scale = 0.25f; _closeButton.sortZ = 1; _closeButton.SignalRelease += HandleCloseButtonRelease; _closeButton.x = Futile.screen.width - 125.0f; _closeButton.y = Futile.screen.height -75.0f; AddChild(_closeButton); Clock clock = new Clock(); clock.SetPosition( 75.0f, Futile.screen.height - 75.0f); AddChild(clock); crewSavedLabel = new FLabel("Emulogic", "Crew Members Saved: 0"); crewSavedLabel.SetPosition( Futile.screen.halfWidth, Futile.screen.height - 45.0f); crewSavedLabel.scale = 0.25f; AddChild(crewSavedLabel); selectedInventory = new FSprite("inventorySelected"); selectedInventory.isVisible = false; AddChild(selectedInventory); //spawnInventory(); spawnCrew(2); _lastCycle = Main.GameTime; }
public static void Rect(Rect rect, Color color) { Draw.rect = rect; FSprite sprite = new FSprite(Pixel); SpriteBatch.AddChild(sprite); sprite.SetAnchor(0, 0); sprite.SetPosition(rect.x, rect.y); sprite.width = rect.width; sprite.height = rect.height; sprite.color = color; //SpriteBatch.Draw(Pixel.Texture2D, rect, Pixel.Rect, color); }
public override void Start() { Main.instance.crewSaved = 0; Main.instance.gameFinished = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _introLabel = new FLabel("Emulogic", ""); _introLabel.color = Color.black; //Color.green; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _introLabel.scale = 0.2f; _introLabel.SetAnchor(0.0f, 1.0f); _introLabel.SetPosition(60, Futile.screen.height - 14); AddChild(_introLabel); _titleLabel = new FLabel("Emulogic", ""); _titleLabel.color = Color.black; _titleLabel.scale = 1.0f; _titleLabel.SetAnchor(0.0f, 1.0f); _titleLabel.SetPosition(200, 550); AddChild(_titleLabel); _finalLabel = new FLabel("Emulogic", ""); _finalLabel.color = Color.black; //Color.green; _finalLabel.scale = 0.2f; _finalLabel.SetAnchor(0.0f, 1.0f); _finalLabel.SetPosition(575, 400); AddChild(_finalLabel); if (!Main.instance.playIntro){ _introLabel.text = _introText; _titleLabel.text = _titleText; _finalLabel.text = _finalText; } _startButton = new FButton("buttonWide"); _startButton.AddLabel("Emulogic","Play!",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _startButton.label.scale = 0.25f; _startButton.SetPosition(Futile.screen.width - 225, 155); AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; _creditsButton = new FButton("buttonWide"); _creditsButton.AddLabel("Emulogic","About",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _creditsButton.label.scale = 0.25f; _creditsButton.SetPosition(Futile.screen.width - 225, 75); AddChild(_creditsButton); _creditsButton.SignalRelease += HandleCreditsButtonRelease; _lastTextUpdate = Main.GameTime; FSprite escapePod = new FSprite("escapePod"); FSprite doors = new FSprite("doorsIcon"); FSprite crew = new FSprite("floatingCharacter"); FSprite clock = new FSprite("moveTileIcon"); //FSprite clock = new FSprite("clock4"); escapePod.scale = 0.5f; doors.scale = 0.5f; escapePod.SetPosition(140, 305); doors.SetPosition(140, 230); crew.SetPosition(140, 155); clock.SetPosition(140, 80); AddChild(escapePod); AddChild(doors); AddChild(crew); AddChild(clock); FLabel escapePodLabel = new FLabel("Emulogic", "Get the crew to \nthe escape pods!"); escapePodLabel.color = Color.black; //Color.green; escapePodLabel.scale = 0.15f; escapePodLabel.SetAnchor(0.0f, 0.5f); escapePodLabel.SetPosition(200, 305); AddChild(escapePodLabel); FLabel doorsLabel = new FLabel("Emulogic", "Touch doors to \nopen and close them."); doorsLabel.color = Color.black; //Color.green; doorsLabel.scale = 0.15f; doorsLabel.SetAnchor(0.0f, 0.5f); doorsLabel.SetPosition(200, 230); AddChild(doorsLabel); FLabel crewLabel = new FLabel("Emulogic", "The Crew. They will walk \nthrough open doors, \nbut don't expect much else."); crewLabel.color = Color.black; //Color.green; crewLabel.scale = 0.15f; crewLabel.SetAnchor(0.0f, 0.5f); crewLabel.SetPosition(200, 155); AddChild(crewLabel); FLabel clockLabel = new FLabel("Emulogic", "Place movement tiles \nto redirect the crew."); //FLabel clockLabel = new FLabel("Emulogic", "10 Seconds."); clockLabel.color = Color.black; //Color.green; clockLabel.scale = 0.15f; clockLabel.SetAnchor(0.0f, 0.5f); clockLabel.SetPosition(200, 80); AddChild(clockLabel); }
public void SetupDashes(List<DashData> dashDatas) { for(int d = 0; d<dashDatas.Count; d++) { FSprite dash = new FSprite("Box"); dash.SetAnchor(0,0); dash.width = dashWidth; dash.height = dashHeight; dash.x = dashOffset.x + d * (dashWidth+dashSpacing); dash.y = dashOffset.y; dash.color = dashDatas[d].color; dashes.Add(dash); dashContainer.AddChild(dash); } }
override public void Start() { Main.instance.crewSaved = 0; Main.instance.gameFinished = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _introLabel = new FLabel("Emulogic", ""); _introLabel.color = Color.black; //Color.green; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _introLabel.scale = 0.2f; _introLabel.SetAnchor(0.0f, 1.0f); _introLabel.SetPosition(60, Futile.screen.height - 14); AddChild(_introLabel); _titleLabel = new FLabel("Emulogic", ""); _titleLabel.color = Color.black; _titleLabel.scale = 1.0f; _titleLabel.SetAnchor(0.0f, 1.0f); _titleLabel.SetPosition(200, 550); AddChild(_titleLabel); _finalLabel = new FLabel("Emulogic", ""); _finalLabel.color = Color.black; //Color.green; _finalLabel.scale = 0.2f; _finalLabel.SetAnchor(0.0f, 1.0f); _finalLabel.SetPosition(575, 400); AddChild(_finalLabel); if (!Main.instance.playIntro) { _introLabel.text = _introText; _titleLabel.text = _titleText; _finalLabel.text = _finalText; } _startButton = new FButton("buttonWide"); _startButton.AddLabel("Emulogic", "Play!", Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _startButton.label.scale = 0.25f; _startButton.SetPosition(Futile.screen.width - 225, 155); AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; _creditsButton = new FButton("buttonWide"); _creditsButton.AddLabel("Emulogic", "About", Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _creditsButton.label.scale = 0.25f; _creditsButton.SetPosition(Futile.screen.width - 225, 75); AddChild(_creditsButton); _creditsButton.SignalRelease += HandleCreditsButtonRelease; _lastTextUpdate = Main.GameTime; FSprite escapePod = new FSprite("escapePod"); FSprite doors = new FSprite("doorsIcon"); FSprite crew = new FSprite("floatingCharacter"); FSprite clock = new FSprite("moveTileIcon"); //FSprite clock = new FSprite("clock4"); escapePod.scale = 0.5f; doors.scale = 0.5f; escapePod.SetPosition(140, 305); doors.SetPosition(140, 230); crew.SetPosition(140, 155); clock.SetPosition(140, 80); AddChild(escapePod); AddChild(doors); AddChild(crew); AddChild(clock); FLabel escapePodLabel = new FLabel("Emulogic", "Get the crew to \nthe escape pods!"); escapePodLabel.color = Color.black; //Color.green; escapePodLabel.scale = 0.15f; escapePodLabel.SetAnchor(0.0f, 0.5f); escapePodLabel.SetPosition(200, 305); AddChild(escapePodLabel); FLabel doorsLabel = new FLabel("Emulogic", "Touch doors to \nopen and close them."); doorsLabel.color = Color.black; //Color.green; doorsLabel.scale = 0.15f; doorsLabel.SetAnchor(0.0f, 0.5f); doorsLabel.SetPosition(200, 230); AddChild(doorsLabel); FLabel crewLabel = new FLabel("Emulogic", "The Crew. They will walk \nthrough open doors, \nbut don't expect much else."); crewLabel.color = Color.black; //Color.green; crewLabel.scale = 0.15f; crewLabel.SetAnchor(0.0f, 0.5f); crewLabel.SetPosition(200, 155); AddChild(crewLabel); FLabel clockLabel = new FLabel("Emulogic", "Place movement tiles \nto redirect the crew."); //FLabel clockLabel = new FLabel("Emulogic", "10 Seconds."); clockLabel.color = Color.black; //Color.green; clockLabel.scale = 0.15f; clockLabel.SetAnchor(0.0f, 0.5f); clockLabel.SetPosition(200, 80); AddChild(clockLabel); }
public static void HollowRect(float x, float y, float width, float height, Color color) { rect.x = (int)x; rect.y = (int)y; rect.width = (int)width; rect.height = 1; FSprite sprite = new FSprite(Pixel); SpriteBatch.AddChild(sprite); sprite.SetAnchor(0, 0); sprite.SetPosition(rect.x, rect.y); sprite.width = rect.width; sprite.height = rect.height; sprite.color = color; //SpriteBatch.Draw(Pixel.Texture2D, rect, Pixel.Rect, color); rect.y += (int)height - 1; sprite = new FSprite(Pixel); SpriteBatch.AddChild(sprite); sprite.SetAnchor(0, 0); sprite.SetPosition(rect.x, rect.y); sprite.width = rect.width; sprite.height = rect.height; sprite.color = color; //SpriteBatch.Draw(Pixel.Texture2D, rect, Pixel.Rect, color); rect.y -= (int)height - 1; rect.width = 1; rect.height = (int)height; sprite = new FSprite(Pixel); SpriteBatch.AddChild(sprite); sprite.SetAnchor(0, 0); sprite.SetPosition(rect.x, rect.y); sprite.width = rect.width; sprite.height = rect.height; sprite.color = color; //SpriteBatch.Draw(Pixel.Texture2D, rect, Pixel.Rect, color); rect.x += (int)width - 1; sprite = new FSprite(Pixel); SpriteBatch.AddChild(sprite); sprite.SetAnchor(0, 0); sprite.SetPosition(rect.x, rect.y); sprite.width = rect.width; sprite.height = rect.height; sprite.color = color; //SpriteBatch.Draw(Pixel.Texture2D, rect, Pixel.Rect, color); }
override public void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); string backButtonText = "Back"; string titleText = "About The Game"; if (Main.instance.gameFinished) { // Display end game messages titleText = "The Ship Went Nuclear!"; _scoreLabel = new FLabel("Emulogic", "You Saved " + Main.instance.crewSaved + " Crew Members"); _scoreLabel.color = Color.black; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _scoreLabel.scale = 0.25f; _scoreLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight / 2); AddChild(_scoreLabel); _againButton = new FButton("buttonWide"); _againButton.AddLabel("Emulogic", "Play Again", Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _againButton.label.scale = 0.25f; _againButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + 80); AddChild(_againButton); _againButton.SignalRelease += HandleAgainButtonRelease; backButtonText = "Home"; } else { // diplay generic message } _textLabel = new FLabel("Emulogic", titleText); _textLabel.color = Color.black; _textLabel.scale = 0.5f; _textLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight * 2 / 3); AddChild(_textLabel); _quitButton = new FButton("buttonWide"); _quitButton.AddLabel("Emulogic", backButtonText, Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _quitButton.label.scale = 0.25f; _quitButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight); AddChild(_quitButton); _quitButton.SignalRelease += HandleQuitButtonRelease; string about = "Game Designed and created by Jason Rendel,\nfor Ludum Dare 27. My first game jam ever!\nCreated for the 48 hour competition.\n\n ---- Tools ----\n Unity 3d - Futile - Gimp \nTexture Packer - Glyph Designer - CFXR\n\nFollow me @jasonrendel\nCheck out what else I'm up to at www.jasonrendel.com"; _scoreLabel = new FLabel("Emulogic", about); _scoreLabel.color = Color.black; _scoreLabel.scale = 0.20f; _scoreLabel.SetPosition(Futile.screen.halfWidth, 200); AddChild(_scoreLabel); }