Browse Source

Added AnchorGUITexture example to Sprite Room.

master
chrisgregan 11 years ago
parent
commit
2b4c75e327
  1. BIN
      Assets/Fungus/Prefabs/AnchorGUITexture.prefab
  2. BIN
      Assets/FungusExample/Scenes/Example.unity
  3. 13
      Assets/FungusExample/Scripts/SpriteRoom.cs

BIN
Assets/Fungus/Prefabs/AnchorGUITexture.prefab

Binary file not shown.

BIN
Assets/FungusExample/Scenes/Example.unity

Binary file not shown.

13
Assets/FungusExample/Scripts/SpriteRoom.cs

@ -11,8 +11,15 @@ namespace Fungus.Example
public SpriteRenderer blueAlienSprite;
public SpriteRenderer redMushroomSprite;
// AnchorGUITexture displays a texture at the same size & position regardless of screen resolution.
// This is handy for displaying simple GUI textures in a consistent manner across devices.
public AnchorGUITexture mushroomLogo;
void OnEnter()
{
// Show the mushroom logo immediately
mushroomLogo.enabled = true;
HideSprite(redMushroomSprite);
ShowSprite(blueAlienSprite);
@ -57,6 +64,12 @@ namespace Fungus.Example
Say("Heh. That Blue Alien - what a guy!");
// We want the mushroom logo to hide just before we move to the menuRoom,
// so we pass a delegate method to the Call command which will execute as part of the command sequence.
Call(delegate {
mushroomLogo.enabled = false;
});
MoveToRoom(menuRoom);
}
}

Loading…
Cancel
Save