本文整理汇总了C#中FSprite类的典型用法代码示例。如果您正苦于以下问题:C# FSprite类的具体用法?C# FSprite怎么用?C# FSprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FSprite类属于命名空间,在下文中一共展示了FSprite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LungLevel
public LungLevel()
{
background_ = new FAnimatedSprite("Lungs_Background");
int[] breathing_frames = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
FAnimation breathing_animation = new FAnimation("breathing", "Lungs_Background", breathing_frames, 250, true);
background_.addAnimation(breathing_animation);
background_.play("breathing");
AddChild(background_);
dust_container_size_ = new Rect(-Futile.screen.halfWidth*2.5f, -Futile.screen.halfHeight*2.5f, Futile.screen.width*2.5f, Futile.screen.height*2.5f);
dust1_ = new Dust("Dust_4", dust_container_size_);
AddChild(dust1_);
tubes1_ = new FSprite("Lungs_Rear");
AddChild(tubes1_);
tubes2_ = new FSprite("Lungs_MidBack1");
AddChild(tubes2_);
dust2_ = new Dust("Dust_3", dust_container_size_);
AddChild(dust2_);
tubes3_ = new FSprite("Lungs_MiddleFore");
AddChild(tubes3_);
tubes4_ = new FSprite("Lungs_Fore");
AddChild(tubes4_);
dust3_ = new Dust("Dust_2", dust_container_size_);
AddChild(dust3_);
}
示例2: FutilePlatformerBaseObject
public FutilePlatformerBaseObject(RXRect hitBox, World world, string shadow ="")
{
this.ySetsSortZ = true;
this.hitBox = hitBox;
this.world = world;
this.tileSize = world.TileSize;
if (C.isDebug)
{
collisionDebugSprite = new FSprite("boundingBox");
collisionDebugSprite.x = hitBox.x;
collisionDebugSprite.y = hitBox.y;
collisionDebugSprite.width = hitBox.width;
collisionDebugSprite.height = hitBox.height;
collisionDebugSprite.sortZ = 100;
this.AddChild(collisionDebugSprite);
}
this.shouldSortByZ = true;
if (!String.IsNullOrEmpty(shadow))
{
this.shadow = new FSprite(shadow);
this.shadow.y = -.1f;
this.AddChild(this.shadow);
}
UpdateCollisionChecks();
}
示例3: Start
public override void Start()
{
background_ = new FSprite("level select screen final");
AddChild(background_);
string highest_level = PlayerPrefs.GetString("highest_level");
if(highest_level.Equals("stomach"))
{
setBrain(ButtonType.locked);
setLungs(ButtonType.locked);
} else if(highest_level.Equals("lung")) {
setBrain(ButtonType.locked);
setLungs(ButtonType.normal);
} else {
setBrain(ButtonType.normal);
setLungs(ButtonType.normal);
}
stomach = new FButton("Stomach", "StomachPressed");
stomach.SignalRelease += HandleStomachButton;
AddChild(stomach);
stomach.SetPosition(STOMACH_POSITION);
background_.scale = 1f;
Go.to(background_, 0.5f, new TweenConfig().setDelay(0.1f).floatProp("scale", 1.0f).setEaseType(EaseType.BackOut));
}
示例4: Arena
public Arena()
{
instance = this;
mapData = MapGenerator.Generate();
FSprite bgSprite = new FSprite("Arena/BG_1");
AddChild(bgSprite);
AddChild(entityArea = new EntityArea());
float inset = 13;
entityArea.bounds.x = -Config.WIDTH/2 + inset;
entityArea.bounds.y = -Config.HEIGHT/2 + inset;
entityArea.bounds.width = Config.WIDTH - inset*2;
entityArea.bounds.height = Config.HEIGHT - inset*2;
colorOverlay = new FSprite("WhiteBox");
colorOverlay.color = new Color(1,1,1,0);
colorOverlay.width = Config.WIDTH;
colorOverlay.height = Config.HEIGHT;
entityArea.overlayContainer.AddChild(colorOverlay);
AddChild(frontContainer = new FContainer());
dayManager = new DayManager();
CreateBuildings();
SetupPlayers();
ListenForUpdate(Update);
}
示例5: LevelBar
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 ();
}
示例6: WTSpriteComponent
public WTSpriteComponent(string name, string imageName)
: base(name)
{
componentType_ = ComponentType.Sprite;
sprite_ = new FSprite(imageName);
}
示例7: SBSpriteComponent
public SBSpriteComponent(string imageName, bool ableToRotate)
{
this.shouldBeInRotatingContainer = ableToRotate;
sprite = new FSprite(imageName);
componentType = ComponentType.Sprite;
name = "sprite component";
}
示例8: getGameUIContainer
public static FContainer getGameUIContainer(GamePage game)
{
if (GameUIContainer == null)
{
GameUIContainer = new FContainer();
// add background
FSprite bg = new FSprite("UI_background.png");
bg.x = 0;
bg.y = Futile.screen.halfHeight - (bg.height / 2);
GameUIContainer.AddChildAtIndex(bg, 99);
// add minimap
GameUIContainer.AddChild(game._dungeon.minimap);
// add gold count
playerGold.text = "g: " + game.player.GoldCount;
playerGold.x += -140;
playerGold.y += Futile.screen.halfHeight - 20;
GameUIContainer.AddChild(playerGold);
// add sanity count
playerSanity.text = game.player.HP.ToString();
playerSanity.x += 260;
playerSanity.y += Futile.screen.halfHeight - 60;
GameUIContainer.AddChild(playerSanity);
return GameUIContainer;
}
else return GameUIContainer;
}
示例9: StateTitle
public StateTitle(StateGame game)
: base(TITLE)
{
//Initialize
m_Game = game;
m_Time = BLINK_DURATION * 2;
m_StartTime = START_DURATION * 2;
//Create background
FSprite Background = new FSprite("rect") { x = Futile.screen.halfWidth, y = Futile.screen.halfHeight, width = Futile.screen.width, height = Futile.screen.height, color = new Color(0, 0, 0, 0.5f) };
AddChild(Background);
//Create stuff
m_Title = new FSprite("logo") { x = Futile.screen.halfWidth, y = Futile.screen.height * 0.6f };
m_Instruction1 = new FLabel("font", "Tap screen to play") { x = Futile.screen.halfWidth, y = Futile.screen.height * 0.2f };
AddChild(m_Instruction1);
AddChild(m_Title);
//Credit
/*FLabel Credit1 = new FLabel("visitor-small", "A game by Karunia Ramadhan, Namira Chaldea, and Raka Mahesa") { x = Futile.screen.halfWidth };
Credit1.y = 4 + (Credit1.textRect.height * 0.5f);
AddChild(Credit1);*/
//Play music
FSoundManager.PlayMusic("bgm", 1f);
}
示例10: UI
public UI()
{
dialogue = new Dialogue();
this.AddChild(dialogue);
background = new FSprite("bg");
slotA = new FSprite("slot_a");
slotB = new FSprite("slot_b");
slotASelected = new FSprite("jump_soul");
slotBSelected = new FSprite("sword_soul");
hearts = new FSprite("heart_full");
this.AddChild(background);
this.AddChild(slotA);
this.AddChild(slotB);
this.AddChild(slotASelected);
this.AddChild(slotBSelected);
this.AddChild(hearts);
slotASelected.isVisible = false;
slotBSelected.isVisible = false;
background.y = Futile.screen.halfHeight - background.height / 2f;
slotB.y = background.y;
slotA.y = background.y;
slotB.x = -Futile.screen.halfWidth + slotB.width / 2f + 20;
slotA.x = slotB.x + slotB.width / 2f + slotA.width / 2f + 3;
slotASelected.SetPosition(slotA.GetPosition());
slotBSelected.SetPosition(slotB.GetPosition());
slotASelected.x += 1;
slotBSelected.x += 1;
hearts.y = background.y;
hearts.x = Futile.screen.halfWidth - hearts.width / 2f - 20;
}
示例11: Start
public override void Start()
{
ShowTitle("GoKit Shake and Oscillate");
_sprites=new List<FSprite>();
_spriteAnims=new List<GoTween>();
//Build the grid
FSprite sprite=new FSprite("Monkey_0");
float scale=0.25f;
float width=sprite.textureRect.width*scale;
float height=sprite.textureRect.height*scale;
int rows=4;
int columns=5;
for(int i=0;i<columns;i++) {
float x=-((float)(columns-1)*0.5f-(float)i)*width;
for(int j=0;j<rows;j++) {
float y=((float)(rows-1)*0.5f-(float)j)*height;
sprite=new FSprite("Monkey_0");
sprite.scale=scale;
sprite.x=x; sprite.y=y;
_sprites.Add(sprite);
AddChild(sprite);
}
}
base.Start();
TempMessage("Click to start",2f);
}
示例12: Start
// Use this for initialization
public override void Start()
{
transitionIn = true;
InitScript.inGame = false;
background = new Starfield(InitScript.bg1Pos,false);
Futile.stage.AddChild(background);
background2 = new Starfield(InitScript.bg2Pos, false);
Futile.stage.AddChild(background2);
menuAnims = new FSprite("MenutoCredits0.png");
menuAnims.scale = 2.0f;
menuAnims.x = 0;
//menuAnims.isVisible = false;
Futile.stage.AddChild(menuAnims);
menuBackground = new FSprite("CreditScreen.png");
menuBackground.scale = 2.0f;
menuBackground.x = 0;
menuBackground.isVisible = false;
Futile.stage.AddChild(menuBackground);
btnInstructions = new FButton("MenuButton.png");
btnInstructions.x -= 1;
btnInstructions.y -= 166;
btnInstructions.scale = 2.0f;
btnInstructions.isVisible = false;
Futile.stage.AddChild(btnInstructions);
InitScript.blackBar1.MoveToTop();
InitScript.blackBar2.MoveToTop();
btnInstructions.SignalRelease += HandleInfoButtonRelease;
Futile.instance.SignalUpdate += HandleUpdate;
}
示例13: StateGame
public StateGame()
: base(GAME)
{
//Initialize
m_ScoreCounterTimers = new List<float>();
m_HealthCounterTimers = new List<float>();
m_HealthChanges = new List<float>();
m_EnemyShootTimer = new List<float>();
m_Started = false;
m_ConsoleLog = new string[CONSOLE_MAX_LINE];
for(int i=0;i<CONSOLE_MAX_LINE;i++) m_ConsoleLog[i] = "";
//Create backgrounds
m_Background11 = new FSprite("clouds") { x = Constants.UNITY_CENTER_X, y = Constants.UNITY_CENTER_Y };
m_Background12 = new FSprite("clouds") { x = Constants.UNITY_CANVAS_RIGHT + (Constants.UNITY_CANVAS_WIDTH / 2f) - 1, y = Constants.UNITY_CENTER_Y };
m_Background22 = new FSprite("hills") { x = Constants.UNITY_CANVAS_RIGHT + (Constants.UNITY_CANVAS_WIDTH / 2f) - 1 };
m_Background21 = new FSprite("hills") { x = Constants.UNITY_CENTER_X };
m_Background21.y = Constants.UNITY_CANVAS_BOTTOM + m_Background21.textureRect.height * 0.5f;
m_Background22.y = Constants.UNITY_CANVAS_BOTTOM + m_Background22.textureRect.height * 0.5f;
AddChild(m_Background11);
AddChild(m_Background12);
AddChild(m_Background21);
AddChild(m_Background22);
//Create components
m_Exa = new Exa();
m_Enemies = new FContainer();
m_EnemyBullets = new FContainer();
m_PlayerBullets = new FContainer();
AddChild(m_Enemies);
AddChild(m_Exa);
AddChild(m_PlayerBullets);
AddChild(m_EnemyBullets);
//Create interface
m_ScoreCounter = new FLabel("font", "") { isVisible = false };
m_ErrorCounter = new FLabel("font", "") { isVisible = false };
m_ScoreOverlay = new FSprite("target") { isVisible = false };
m_HealthOverlay = new FSprite("target") { isVisible = false };
m_HealthGauge = new FSprite("gauge") { isVisible = false };
m_HealthBar = new FSprite("rect") { isVisible = false, color = new Color(0, 1, 0, 1) };
//Add
AddChild(m_HealthBar);
AddChild(m_HealthGauge);
//AddChild(m_ErrorCounter);
AddChild(m_ScoreCounter);
AddChild(m_ScoreOverlay);
AddChild(m_HealthOverlay);
//Create unity canvas
m_Unity = new FSprite("unity") { x = Futile.screen.halfWidth, y = Futile.screen.halfHeight };
m_Console = new FLabel[CONSOLE_MAX_LINE];
for(int i=0;i<CONSOLE_MAX_LINE;i++) m_Console[i] = new FLabel("font_console", "") { isVisible = false };
//Add
AddChild(m_Unity);
foreach(FLabel line in m_Console) AddChild(line);
}
示例14: Start
public override void Start()
{
ShowTitle("ListDelayedActions\nClick to start the chain");
_sprites=new List<FSprite>();
//Build the grid
FSprite sprite=new FSprite("Monkey_0");
float scale=0.25f;
float width=sprite.textureRect.width*scale;
float height=sprite.textureRect.height*scale;
int rows=4;
int columns=5;
for(int i=0;i<columns;i++) {
float x=-((float)(columns-1)*0.5f-(float)i)*width;
for(int j=0;j<rows;j++) {
float y=((float)(rows-1)*0.5f-(float)j)*height;
sprite=new FSprite("Monkey_0");
sprite.scale=scale;
sprite.x=x; sprite.y=y;
_sprites.Add (sprite);
AddChild(sprite);
}
}
base.Start();
}
示例15: HealthBar
public HealthBar(float offsetX, float offsetY, float width, float height, float percentage)
{
this.offsetX = offsetX;
this.offsetY = offsetY;
_width = width;
_height = height;
_background = new FSprite("Futile_White");
_background.width = _width;
_background.height = _height;
_bar = new FSprite("Futile_White");
_bar.height = _height - DOUBLE_INSET;
_bar.anchorX = 0.0f;
_bar.x = -_width*0.5f + INSET;
_background.color = new Color(0.15f,0.22f,0.35f);
_percentage = Mathf.Clamp01(percentage);
this.alpha = 0.0f;
UpdatePercentage();
ListenForUpdate(HandleUpdate);
}