void HandleResize(bool wasResizedDueToOrientationChange) { for (int s = 0; s < Futile.GetStageCount(); s++) { Futile.GetStageAt(s).scale = Futile.screen.width / 1280.0f; //keep it full screen always! } }
// Use this for initialization private void Awake () { instance = this; isOpenGL = SystemInfo.graphicsDeviceVersion.Contains("OpenGL"); enabled = false; name = "Futile"; }
public override void Init() { SetStage(new FStage("LOGO")); Futile.AddStage(GetStage()); SetPixelOffset(0, 0, Futile.screen.width, Futile.screen.height); tEditor = new LogoEditor(this); }
// Use this for initialization private void Awake() { instance = this; isOpenGL = SystemInfo.graphicsDeviceVersion.Contains("OpenGL"); enabled = false; name = "Futile"; }
public void HandleWin() { FStage UIstage = new FStage("UI"); Futile.AddStage(UIstage); UIstage.AddChild(new FLabel("Abstract", string.Format("WINNER\nSAVED: {0}", c.PersonCount))); RemoveListenForUpdate(); }
public void HandleGameOver() { FStage UIstage = new FStage("UI"); Futile.AddStage(UIstage); UIstage.AddChild(new FLabel("Abstract", "GAME OVER")); RemoveListenForUpdate(); }
// Use this for initialization void Start() { FutileParams futileParams = new FutileParams(true, true, true, true); manager = new MouseManager(this); futileParams.AddResolutionLevel(800, 1, 1, ""); futileParams.origin = new Vector2( 0.0f, 0.0f); Futile.instance.Init(futileParams); Futile.atlasManager.LoadImage("grasstile"); Futile.atlasManager.LoadImage("foresttile"); Futile.atlasManager.LoadImage("soldier"); Futile.atlasManager.LoadImage("bluehighlight"); var tileSize = 30; var width = 50; var height = 35; var tiles = new TileProperties[width, height]; var grassTile = new TileProperties() { SpriteName = "grasstile", MovementPenalty = 1 }; var forestTile = new TileProperties() { SpriteName = "foresttile", MovementPenalty = 2 }; var actorProps = new ActorProperties() { SpriteName = "soldier", Name = "Hunkfort", MovementPoints = 5 }; var rand = new System.Random(); for (int ii = 0; ii < width; ii++) { for (int jj = 0; jj < height; jj++) { tiles[ii, jj] = (rand.NextDouble() < 0.7) ? grassTile : forestTile; } } this.map = new Map(tiles, tileSize); this.map.AddActor(actorProps, new Vector2i(5, 5)); this.map.Start(); tileStage = new FStage("test"); Futile.AddStage(tileStage); tileStage.stage.AddChild(this.map); }
// Use this for initialization private void Awake() { instance = this; isOpenGL = SystemInfo.graphicsDeviceVersion.Contains("OpenGL"); enabled = false; name = "Futile"; // Force everything to be CultureInvariant. This breaks lots of parsing stuff if you don't do it. Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture; }
private static void AddBackground() { if (Futile.instance != null && Futile.instance.enabled == true) { if (tBackground == null) { tBackground = new FSprite("blank"); tBackground.color = Color.grey; tBackground.width = Futile.screen.width; tBackground.height = Futile.screen.height; tBackgroundStage.AddChild(tBackground); Futile.AddStageAtIndex(tBackgroundStage, 0); } } }
void SetupUI() { FStage uiStage = new FStage("uiStage"); timer = new FLabel("Abstract", st.TimeStamp); bestTime = new FLabel("Abstract", "Best:\n" + st.TimeStamp); timer.SetAnchor(0, 1); timer.scale = 3; bestTime.SetAnchor(0, 1); bestTime.x = Futile.screen.width - bestTime.textRect.width * 3; bestTime.scale = 3; uiStage.AddChild(timer); uiStage.AddChild(bestTime); Futile.AddStage(uiStage); }
public static void SwitchToScene(SceneType sceneType) { FStage oldScene = null; oldScene = currentScene; if (sceneType == SceneType.MergeNamesScene) { currentScene = new TMergeNamesScene(); } else if (sceneType == SceneType.ClickHeartsScene) { currentScene = new TClickHeartsScene(); } else if (sceneType == SceneType.PeopleSceneGoalOne) { currentScene = new TPeopleScene(GoalType.GoalOne); goalOneTutorialIsDone = true; } else if (sceneType == SceneType.PeopleSceneGoalTwo) { currentScene = new TPeopleScene(GoalType.GoalTwo); } else if (sceneType == SceneType.PeopleSceneGoalThree) { currentScene = new TPeopleScene(GoalType.GoalThree); } else if (sceneType == SceneType.DreamSceneOne) { currentScene = new TDreamScene(DreamSceneType.DreamSceneOne); } else if (sceneType == SceneType.DreamSceneTwo) { currentScene = new TDreamScene(DreamSceneType.DreamSceneTwo); } if (oldScene != null) { currentScene.alpha = 0; Go.to(oldScene, 0.3f, new TweenConfig().floatProp("alpha", 0.0f).onComplete(OnOldSceneCompletedFadingOut)); Go.to(currentScene, 0.3f, new TweenConfig().floatProp("alpha", 1.0f)); } Futile.AddStage(currentScene); Futile.AddStage(labelDisplayLayer); // move to top }
protected void UpdateHoverState() { if (_hoverElement == null || !_shouldCheckForHoverState) { return; } Vector2 touchPos = _bg.GlobalToLocal(Futile.MousePosition()); Rect expandedRect = _bg.textureRect.CloneWithExpansion(expansionAmount); if (expandedRect.Contains(touchPos)) { _bg.element = _hoverElement; } else { _bg.element = _upElement; } }
public void SwitchToScene(SceneType sceneType) { if (currentScene != null) { Futile.RemoveStage(currentScene); } if (sceneType == SceneType.Immunity) { currentScene = new WTImmunity(); } if (sceneType == SceneType.None) { currentScene = null; } if (currentScene != null) { Futile.AddStage(currentScene); } }
void Start() { FutileParams fp = new FutileParams(true, true, false, false); fp.AddResolutionLevel(960f, 1.0f, 1.0f, ""); fp.origin = Vector2.zero; fp.backgroundColor = Color.white; Futile.instance.Init(fp); Futile.atlasManager.LoadAtlas("Atlases/MainSheet"); Futile.atlasManager.LoadAtlas("Atlases/ExtrudersSheet"); Futile.atlasManager.LoadFont("Burnstown", "Burnstown.png", "Atlases/Burnstown"); Futile.atlasManager.LoadFont("Exotica", "Exotica.png", "Atlases/Exotica"); Futile.atlasManager.LoadFont("SoftSugar", "SoftSugar.png", "Atlases/SoftSugar"); Futile.atlasManager.LoadImage("Atlases/clouds"); labelDisplayLayer = new TLabelDisplayLayer(); Futile.AddStage(labelDisplayLayer); SwitchToScene(SceneType.PeopleSceneGoalOne); }
public void RemoveUselessFiles() { var f = new Futile(Console.Out); var q = new FsQuery(this.f.ParentPath, new string[] { "/.git", "^/Releases", "^/Tests/Builder" }); //delete /Tests/binaries (*.pdb, *.xml, *.dll) //delete /Core/obj folder //Deleate all bin,obj,imageacache,uploads, and results folders under /Samples, /Tests, and /Plugins f.DelFiles(q.files("^/(Tests|Plugins|Samples)/*/(bin|obj|imagecache|uploads|results)/*", "^/Core/obj/*", "^/Core.Mvc/obj/*")); f.DelFiles(q.files("^/Samples/MvcSample/App_Data/*")); //delete .xml and .pdb files for third-party libs f.DelFiles(q.files("^/dlls/*/(Aforge|LitS3|Ionic)*.(pdb|xml)$")); //delete Thumbs.db //delete */.DS_Store f.DelFiles(q.files("/Thumbs.db$", "/.DS_Store$")); q = null; }
private void OnApplicationQuit() { instance = null; }
public void ListenForUpdate(Futile.FutileUpdateDelegate handleUpdateCallback) { RemoveEnablerOfType(typeof(FNodeEnablerForUpdate)); AddEnabler(new FNodeEnablerForUpdate(handleUpdateCallback)); }
public static void AddTextStage() { Futile.AddStage(tTextStage); }
public static void OnOldSceneCompletedFadingOut(AbstractTween tween) { FStage oldScene = (tween as Tween).target as FStage; Futile.RemoveStage(oldScene); }
private void OnDestroy() { instance = null; }
public void ShutDown() { Futile.RemoveStage(stage); }
public FNodeEnablerForLateUpdate(Futile.FutileUpdateDelegate handleUpdateCallback) { this.handleUpdateCallback = handleUpdateCallback; }
public WTImmunity() : base("") { instance = this; Futile.AddStage(this); gameLayer = new FContainer(); gameLayer.x = Futile.screen.halfWidth; gameLayer.y = Futile.screen.halfHeight; gameLayer.scale = 0.23f; zoomLevel_ = gameLayer.scale; AddChild(gameLayer); inventory = new List <ImAbstractItem>(); inventory.Add(new ImHealthPill("Health Pill", 15)); inventory.Add(new ImPoisonPill("Poison Pill", 6)); inventory.Add(new ImPoisonPill("Poison Pill", 17)); inventory.Add(new ImHealthPill("Health Pill", 5)); inventory.Add(new ImPoisonPill("Poison Pill", 30)); inventory.Add(new ImHealthPill("Health Pill", 7)); inventory.Add(new ImHealthPill("Health Pill", 42)); float sliceWidth = 460f / 4f; float sliceHeight = 436f / 4f; int sliceHorizontalCount = 6; int sliceVerticalCount = 16; float bodyWidth = sliceWidth * sliceHorizontalCount; float bodyHeight = sliceHeight * sliceVerticalCount; FContainer bodyContainer = new FContainer(); bodyContainer.x -= bodyWidth / 2f; bodyContainer.y -= bodyHeight / 2f; gameLayer.AddChild(bodyContainer); for (int i = 0; i < sliceVerticalCount; i++) { for (int j = 0; j < sliceHorizontalCount; j++) { int imageNum = i * sliceHorizontalCount + j + 1; string imageName = string.Format("bodySlices/body_{0}.png", imageNum.ToString("D2")); FSprite slice = new FSprite(imageName); slice.anchorX = slice.anchorY = 0; slice.x = j * sliceWidth; slice.y = bodyHeight - (i + 1) * sliceHeight; bodyContainer.AddChild(slice); } } organLayer = new ImOrganLayer(); organLayer.owner = this; gameLayer.AddChild(organLayer); veinLayer = new ImVeinLayer(); veinLayer.owner = this; gameLayer.AddChild(veinLayer); nodeLayer = new ImNodeLayer(); nodeLayer.owner = this; gameLayer.AddChild(nodeLayer); /*pop = new ImPopoverDialogue(100f, 100f, 4f, PopoverTriangleDirectionType.PointingRight); * AddChild(pop);*/ pop = new WTPopoverDialogue(false, "popover!"); pop.SignalNeedsInventoryRefresh += HandlePopoverNeedsInventoryRefresh; pop.SignalItemUsed += HandleItemUsed; pop.x = Futile.screen.halfWidth; pop.y = Futile.screen.halfHeight; pop.width = 200f; pop.isVisible = false; AddChild(pop); uiLayer = new ImUILayer(); SignalPauseStateChanged += uiLayer.SetTransportBar; AddChild(uiLayer); ImNode node = nodeLayer.NodeForPlacement(NodePlacement.ElbowRight); node.Infect(testVirus); node.InfectionComponent().StartInfecting(); }