本文整理汇总了C#中FNode.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# FNode.SetPosition方法的具体用法?C# FNode.SetPosition怎么用?C# FNode.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FNode
的用法示例。
在下文中一共展示了FNode.SetPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadNewMap
public void LoadNewMap(string mapName)
{
currentState = State.TRANS;
C.getCameraInstance().setWorldBounds(new Rect(0, -loadMap.height, 0, 0));
FNode followNode = new FNode();
followNode.SetPosition(C.getCameraInstance().GetPosition());
C.getCameraInstance().follow(followNode);
Vector2 dir = RXRandom.Vector2Normalized();
float dist = 600;
followNode.alpha = 0;
Go.to(followNode, .3f, new TweenConfig().floatProp("alpha", 1).onComplete(() => { FSoundManager.PlaySound("transition"); }));
Go.to(followNode, 1.0f, new TweenConfig().floatProp("x", dir.x * dist, true).floatProp("y", dir.y * dist, true).setEaseType(EaseType.BackIn).onComplete(() =>
{
LoadMap(mapName);
followNode.x = p.x - dir.x * dist;
followNode.y = p.y - dir.y * dist;
C.getCameraInstance().x = p.x - dir.x * dist;
C.getCameraInstance().y = p.y - dir.y * dist;
if (!ui.isVisible)
{
ui.y = 50;
ui.isVisible = true;
Go.to(ui, 2.0f, new TweenConfig().floatProp("y", 0).setEaseType(EaseType.BackOut));
}
Go.to(followNode, 1.0f, new TweenConfig().floatProp("x", p.x).floatProp("y", p.y).setEaseType(EaseType.BackOut).onComplete(() =>
{
UpdateWorldBounds();
C.getCameraInstance().follow(p);
p.CurrentState = Player.State.IDLE;
inDeadMode = false;
NextWave();
}));
}));
}
示例2: Start
// Use this for initialization
void Start()
{
FutileParams futileParams = new FutileParams(true, false, false, false);
futileParams.AddResolutionLevel(640.0f / 4f, 1.0f, 1.0f, "");
futileParams.origin = new Vector2(0.5f, 0.5f);
futileParams.backgroundColor = new Color(0 / 255.0f, 94 / 255.0f, 38 / 255.0f);
futileParams.shouldLerpToNearestResolutionLevel = true;
Futile.instance.Init(futileParams);
// UnityEngine.Screen.SetResolution(640, 480, false);
Futile.atlasManager.LoadAtlas("Atlases/inGameAtlas");
Futile.atlasManager.LoadFont(C.smallFontName, "smallFont_0", "Atlases/smallFont", 0, 0);
Futile.atlasManager.LoadFont(C.largeFontName, "largeFont_0", "Atlases/largeFont", 0, 0);
FSoundManager.PlayMusic("OGreatBG");
C.getCameraInstance().SetPosition(Futile.screen.halfWidth, -Futile.screen.halfHeight);
FSprite bevelOverlay = new FSprite(Futile.whiteElement);
bevelOverlay.width = Futile.screen.width;
bevelOverlay.height = Futile.screen.height;
bevelOverlay.shader = FShader.Basic_PixelSnap;
bevelOverlay.sortZ = 100;
w = new World();
Futile.stage.AddChild(w);
twitter = new FLabel(C.smallFontName, "@MaggardJosh");
twitter.x = Futile.screen.halfWidth - twitter.textRect.width / 2f;
twitter.y = -Futile.screen.halfHeight + twitter.textRect.height / 2f;
C.getCameraInstance().AddChild(twitter);
madeForLD = new FLabel(C.smallFontName, "Made in 48 hours\nfor Ludum Dare 33");
madeForLD.alignment = FLabelAlignment.Left;
madeForLD.x = -Futile.screen.halfWidth;
madeForLD.y = -Futile.screen.halfHeight + madeForLD.textRect.height / 2f;
C.getCameraInstance().AddChild(madeForLD);
w.LoadMap("titleMap");
w.currentState = World.State.IN_GAME;
w.UpdateWorldBounds();
Futile.stage.AddChild(C.getCameraInstance());
C.getCameraInstance().SetPosition(w.p.GetPosition());
C.getCameraInstance().AddChild(bevelOverlay);
w.p.CurrentState = Player.State.DYING;
tempFollowNode = new FNode();
tempFollowNode.SetPosition(w.p.GetPosition());
C.getCameraInstance().follow(tempFollowNode);
StartRandomMapMovement();
w.ui.isVisible = false;
w.p.SetPosition(-1000, 1000);
pressStart = new FLabel(C.smallFontName, "CLICK TO START");
C.getCameraInstance().AddChild(pressStart);
pressStart.y = -Futile.screen.halfHeight * .3f;
pressStart.alpha = 0;
o = new FLabel(C.largeFontName, "O");
o.alignment = FLabelAlignment.Left;
g = new FLabel(C.largeFontName, "G");
r = new FLabel(C.largeFontName, "R");
e = new FLabel(C.largeFontName, "E");
g.alignment = FLabelAlignment.Left;
r.alignment = FLabelAlignment.Left;
e.alignment = FLabelAlignment.Left;
a = new FLabel(C.largeFontName, "A");
a.alignment = FLabelAlignment.Left;
t = new FLabel(C.largeFontName, "T");
t.alignment = FLabelAlignment.Left;
ogreatContainer = new FContainer();
ogreatContainer.AddChild(o);
ogreatContainer.AddChild(g);
ogreatContainer.AddChild(r);
ogreatContainer.AddChild(e);
ogreatContainer.AddChild(a);
ogreatContainer.AddChild(a);
ogreatContainer.AddChild(t);
C.getCameraInstance().AddChild(ogreatContainer);
e.x = -e.textRect.width / 2f;
r.x = e.x - r.textRect.width;
g.x = r.x - g.textRect.width;
o.x = g.x - o.textRect.width - 10;
a.x = e.x + e.textRect.width;
t.x = a.x + a.textRect.width;
ogreatContainer.y = Futile.screen.height * .3f;
ogreatContainer.x = 10;
float duration = 2.0f;
float initDuration = .8f;
Color greenColor = new Color(0, .3f, 0);
o.y = g.y = r.y = e.y = a.y = t.y = Futile.screen.halfHeight;
Go.to(o, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.5f).setEaseType(EaseType.BackOut));
Go.to(g, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.6f).setEaseType(EaseType.BackOut));
Go.to(r, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.7f).setEaseType(EaseType.BackOut));
Go.to(e, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.8f).setEaseType(EaseType.BackOut));
//.........这里部分代码省略.........
示例3: Cancel
public static void Cancel(FNode node)
{
OscilUtil instance=null;
pendings.TryGetValue(node, out instance);
if (instance!=null) {
instance.chain.destroy();
node.SetPosition(instance.memoPos);
pendings.Remove(node);
}
}
示例4: OpenDoor
public void OpenDoor(string doorName)
{
foreach (FutilePlatformerBaseObject o in collisionObjects)
{
if (!(o is Door))
continue;
Door d = (Door)o;
if (d.name.ToLower() == doorName.ToLower())
{
C.isTransitioning = true;
FNode tempFollowNode = new FNode();
tempFollowNode.SetPosition(player.GetPosition());
C.getCameraInstance().follow(tempFollowNode);
Go.to(tempFollowNode, 2.0f, new TweenConfig().floatProp("x", d.x).floatProp("y", d.y).setEaseType(EaseType.QuadInOut).onComplete(() =>
{
C.getCameraInstance().shake(.6f, .5f);
d.Open();
Go.to(tempFollowNode, 1.5f, new TweenConfig().floatProp("x", player.x).floatProp("y", player.y).setEaseType(EaseType.QuadInOut).setDelay(1.3f).onComplete(() =>
{
C.getCameraInstance().follow(player);
C.isTransitioning = false;
}));
}));
}
}
}