本文整理汇总了C#中FStage.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# FStage.AddChild方法的具体用法?C# FStage.AddChild怎么用?C# FStage.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FStage
的用法示例。
在下文中一共展示了FStage.AddChild方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GoToMenu
public void GoToMenu(PageType pageType)
{
if(currentPageType == pageType) return; // already on this menu
// Get the stage
stage_ = Futile.stage;
// Remove the current page if it exists
if(currentPage != null && stage_ != null){
stage_.RemoveChild(currentPage);
}
// Set new page and page type
switch(pageType){
case PageType.TitlePage:
currentPageType = PageType.TitlePage;
currentPage = new TitlePage();
break;
case PageType.LevelSelectPage:
currentPageType = PageType.LevelSelectPage;
currentPage = new LevelSelectPage();
break;
case PageType.CreditsPage:
currentPageType = PageType.CreditsPage;
currentPage = new CreditsPage();
break;
}
// Add the page and init it
stage_.AddChild(currentPage);
currentPage.Start();
}
示例2: FSceneManager
private FSceneManager()
: base()
{
mScenes = new List<FScene>();
mRemoveScenes = new List<FScene>();
mStage = Futile.stage;
mStage.AddChild( this );
ListenForUpdate( HandleUpdate );
}
示例3: Start
void Start()
{
instance = this;
FutileParams fparams = new FutileParams(true, true, false, false);
fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
fparams.origin = new Vector2(0.5f, 0.5f);
Futile.instance.Init(fparams);
Futile.atlasManager.LoadAtlas("Atlases/CombatAtlas");
Futile.atlasManager.LoadAtlas("Atlases/stomach_atlas");
Futile.atlasManager.LoadAtlas("Atlases/lung_background");
Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
Futile.atlasManager.LoadAtlas("Atlases/lung_dust");
Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");
Futile.atlasManager.LoadAtlas ("Atlases/Victory-DefeatAtlas");
FSoundManager.PreloadSound("player_hit");
FSoundManager.PreloadSound("bacteria_pop");
Futile.atlasManager.LogAllElementNames();
stage_ = Futile.stage;
camera_ = new FCamObject();
stage_.AddChild(camera_);
//Rect worldBounds = stage.worldBounds;
camera_.setWorldBounds (worldBounds);
//make the camera follow the player
camera_.setBounds(cameraBounds);
gamePage = new CombatPage();
gamePage.Start();
camera_.AddChild(gamePage);
}
示例4: World
public World()
{
instance = this;
isGameOver = false;
root = FPWorld.Create(64.0f);
AddChild(backParticles = new FParticleSystem(150));
AddChild(chainHolder = new FContainer());
AddChild(beastShadowHolder = new FContainer());
AddChild(beastHolder = new FContainer());
AddChild(effectHolder = new FContainer());
AddChild(glowParticles = new FParticleSystem(150));
glowParticles.shader = FShader.Additive;
AddChild(orbHolder = new FContainer());
uiStage = new FStage("UIStage");
Futile.AddStage(uiStage);
uiStage.scale = Futile.stage.scale;
uiStage.AddChild(uiHolder = new FContainer());
teams = GameManager.instance.activeTeams;
InitBeasts();
InitOrbs();
InitUI();
spawnRateMultiplier = 1.0f;
walls = new Walls(this);
ListenForUpdate(HandleUpdate);
Input.ResetInputAxes();
}
示例5: Start
private void Start()
{
instance = this;
Go.defaultEaseType = EaseType.Linear;
Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;
//Screen.showCursor = false;
//Time.timeScale = 0.1f;
bool landscape = true;
bool portrait = false;
bool isIPad = SystemInfo.deviceModel.Contains("iPad");
bool shouldSupportPortraitUpsideDown = isIPad && portrait; //only support portrait upside-down on iPad
FutileParams fparams = new FutileParams(landscape, landscape, portrait, shouldSupportPortraitUpsideDown);
fparams.backgroundColor = RXUtils.GetColorFromHex(0x000000); //light blue 0x94D7FF or 0x74CBFF
//fparams.AddResolutionLevel(2560.0f, 2.0f, 2.0f, ""); //1280x720
//fparams.AddResolutionLevel(1280.0f, 1.0f, 2.0f, ""); //1280x720
fparams.AddResolutionLevel(1920.0f, 1.5f, 2.0f, ""); //1920x1080
fparams.AddResolutionLevel(960.0f, 0.75f, 2.0f, ""); //960x540
fparams.origin = new Vector2(0.5f,0.5f);
Futile.instance.Init (fparams);
Futile.atlasManager.LoadAtlas("Atlases/UIAtlas");
Futile.atlasManager.LoadAtlas("Atlases/UIFonts");
Futile.atlasManager.LoadAtlas("Atlases/BackgroundAtlas");
Futile.atlasManager.LoadAtlas("Atlases/GameAtlas");
FTextParams textParams;
textParams = new FTextParams();
textParams.lineHeightOffset = -8.0f;
Futile.atlasManager.LoadFont("Franchise","FranchiseFont", "Atlases/FranchiseFont", -2.0f,-5.0f,textParams);
textParams = new FTextParams();
textParams.kerningOffset = -0.5f;
textParams.lineHeightOffset = -8.0f;
Futile.atlasManager.LoadFont("CubanoInnerShadow","Cubano_InnerShadow", "Atlases/CubanoInnerShadow", 0.0f,2.0f,textParams);
textParams = new FTextParams();
textParams.lineHeightOffset = -8.0f;
textParams.kerningOffset = -0.5f;
Futile.atlasManager.LoadFont("CubanoBig","Cubano136", "Atlases/Cubano136", 0.0f,2.0f,textParams);
GamepadManager.Init();
GameManager.Init();
_stage = Futile.stage;
_stage.AddChild(background = new Background());
GoToPage(TPageType.PagePlayerSelect);
_stage.ListenForUpdate (HandleUpdate);
FSoundManager.isMuted = !GameConfig.IS_SOUND_ON;
_stage.ListenForResize(HandleResize);
}
示例6: Start
private void Start()
{
instance = this;
bool isIPad = SystemInfo.deviceModel.Contains("iPad");
bool shouldSupportPortraitUpsideDown = isIPad; //only support portrait upside-down on iPad
FutileParams fparams = new FutileParams(true,true,true,shouldSupportPortraitUpsideDown);
fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "_Scale1"); //iPhone
fparams.AddResolutionLevel(960.0f, 2.0f, 2.0f, "_Scale2"); //iPhone 4 retina
fparams.AddResolutionLevel(1024.0f, 2.0f, 2.0f, "_Scale2"); //iPad and iPad Mini
fparams.AddResolutionLevel(1136.0f, 2.0f, 2.0f, "_Scale2"); //iPhone 5 retina
fparams.AddResolutionLevel(1280.0f, 2.0f, 2.0f, "_Scale2"); //Nexus 7
fparams.AddResolutionLevel(2048.0f, 4.0f, 4.0f, "_Scale4"); //iPad Retina
fparams.origin = new Vector2(0.5f,0.5f);
Futile.instance.Init (fparams);
Futile.atlasManager.LoadAtlas("Atlases/Atlas");
Futile.atlasManager.LoadFont("Franchise","FranchiseFont" + Futile.resourceSuffix, "Atlases/FranchiseFont" + Futile.resourceSuffix, -2.0f,-5.0f);
stage = Futile.stage;
showMenu();
stats = new Stats();
stage.AddChild( stats );
}
示例7: Start
void Start()
{
instance = this;
FutileParams fparams = new FutileParams(true, true, false, false);
fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
fparams.origin = new Vector2(0.5f, 0.5f);
Futile.instance.Init(fparams);
Futile.atlasManager.LoadAtlas("Atlases/HuroCombatAtlas");
Futile.atlasManager.LoadAtlas("Atlases/EnemyCombatAtlas");
if(stage_name.Equals("stomach"))
{
Futile.atlasManager.LoadAtlas("Atlases/StomachAtlas1");
Futile.atlasManager.LoadAtlas("Atlases/StomachAtlas2");
}
else if(stage_name.Equals("lung"))
{
Futile.atlasManager.LoadAtlas("Atlases/LungBackground1");
Futile.atlasManager.LoadAtlas("Atlases/LungBackground2");
Futile.atlasManager.LoadAtlas("Atlases/LungBackground3");
Futile.atlasManager.LoadAtlas("Atlases/LungBackground4");
Futile.atlasManager.LoadAtlas("Atlases/LungBackground5");
Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
Futile.atlasManager.LoadAtlas("Atlases/DustRear");
Futile.atlasManager.LoadAtlas("Atlases/DustMid");
Futile.atlasManager.LoadAtlas("Atlases/DustFore");
}
else
{
Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");
}
Futile.atlasManager.LoadAtlas("Atlases/MenuWords");
Futile.atlasManager.LoadAtlas ("Atlases/VictoryDefeatAtlas");
FSoundManager.PreloadSound("player_hit");
FSoundManager.PreloadSound("bacteria_pop");
FSoundManager.PreloadSound("enemy_hit");
Futile.atlasManager.LogAllElementNames();
stage_ = Futile.stage;
camera_ = new FCamObject();
stage_.AddChild(camera_);
//Rect worldBounds = stage.worldBounds;
//camera_.setWorldBounds (worldBounds);
//camera_.setBounds(stage.cameraBounds);
gamePage = new CombatPage();
gamePage.Start();
camera_.AddChild(gamePage);
}