本文整理汇总了C#中ICharacter.PixelPerfect方法的典型用法代码示例。如果您正苦于以下问题:C# ICharacter.PixelPerfect方法的具体用法?C# ICharacter.PixelPerfect怎么用?C# ICharacter.PixelPerfect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICharacter
的用法示例。
在下文中一共展示了ICharacter.PixelPerfect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAsync
public async Task<ICharacter> LoadAsync(IGame game)
{
_game = game;
IGameFactory factory = game.Factory;
AGSLoadImageConfig loadConfig = new AGSLoadImageConfig(new AGS.API.Point(0, 0));
IOutfit outfit = await factory.Outfit.LoadOutfitFromFoldersAsync(_baseFolder,
walkLeftFolder: "Walk/left", walkDownFolder: "Walk/down", walkRightFolder: "Walk/right", walkUpFolder: "Walk/up",
idleLeftFolder: "Idle/left", idleDownFolder: "Idle/down", idleRightFolder: "Idle/right", idleUpFolder: "Idle/up",
speakLeftFolder: "Talk/left", speakDownFolder: "Talk/down", speakRightFolder: "Talk/right", speakUpFolder: "Talk/up",
loadConfig: loadConfig);
_character = factory.Object.GetCharacter("Beman", outfit).Remember(_game, character =>
{
_character = character;
subscribeEvents();
});
_character.SpeechConfig.TextConfig = AGSTextConfig.ChangeColor(_character.SpeechConfig.TextConfig, Colors.CornflowerBlue, Colors.Black, 1f);
_character.SpeechConfig.TextOffset = new PointF(0f, -10f);
//Uncomment for portrait
/*
var portrait = game.Factory.Object.GetObject("BemanPortrait");
portrait.StartAnimation(game.Factory.Graphics.LoadAnimationFromFolder(_baseFolder + "Talk/down"));
portrait.Border = AGSBorders.SolidColor(Colors.AliceBlue, 3f, true);
portrait.Visible = false;
portrait.RenderLayer = AGSLayers.Speech;
portrait.IgnoreViewport = true;
portrait.IgnoreScalingArea = true;
game.State.UI.Add(portrait);
_character.SpeechConfig.PortraitConfig = new AGSPortraitConfig { Portrait = portrait, Positioning = PortraitPositioning.Alternating };
*/
var speakAnimation = _character.Outfit[AGSOutfit.Speak];
Characters.RandomAnimationDelay(speakAnimation.Left);
Characters.RandomAnimationDelay(speakAnimation.Right);
Characters.RandomAnimationDelay(speakAnimation.Down);
Characters.RandomAnimationDelay(speakAnimation.Up);
_character.StartAnimation (_character.Outfit[AGSOutfit.Idle].Down);
_character.Hotspot = "Beman";
_character.PixelPerfect(true);
Characters.Beman = _character;
_dialogs.Load(game);
return _character;
}
示例2: LoadAsync
public async Task<ICharacter> LoadAsync(IGame game)
{
AGSLoadImageConfig loadConfig = new AGSLoadImageConfig(new AGS.API.Point(0, 0));
var footstep = await game.Factory.Sound.LoadAudioClipAsync("../../Assets/Sounds/151238__owlstorm__hard-female-footstep-2.wav");
ISoundEmitter emitter = new AGSSoundEmitter (game);
emitter.AudioClip = footstep;
IOutfit outfit = await game.Factory.Outfit.LoadOutfitFromFoldersAsync(_baseFolder, walkLeftFolder: "Walk/left",
walkDownFolder: "Walk/front", idleLeftFolder: "Idle/left", idleDownFolder: "Idle/front",
speakLeftFolder: "Talk", loadConfig: loadConfig);
_character = game.Factory.Object.GetCharacter("Cris", outfit).Remember(game, c => _character = c);
_character.SpeechConfig.TextConfig = AGSTextConfig.ChangeColor(_character.SpeechConfig.TextConfig, Colors.OrangeRed, Colors.Black, 1f);
_character.AddComponent<IApproachComponent>();
emitter.Object = _character;
//Uncomment for portrait
/*
var portrait = game.Factory.Object.GetObject("CrisPortrait");
portrait.StartAnimation(game.Factory.Graphics.LoadAnimationFromFolder(_baseFolder + "Talk"));
portrait.Border = AGSBorders.SolidColor(Colors.AliceBlue, 3f, true);
portrait.Visible = false;
portrait.RenderLayer = AGSLayers.Speech;
portrait.IgnoreViewport = true;
portrait.IgnoreScalingArea = true;
game.State.UI.Add(portrait);
_character.SpeechConfig.PortraitConfig = new AGSPortraitConfig { Portrait = portrait, Positioning = PortraitPositioning.Alternating };
*/
var speakAnimation = _character.Outfit[AGSOutfit.Speak];
Characters.RandomAnimationDelay(speakAnimation.Left);
Characters.RandomAnimationDelay(speakAnimation.Right);
emitter.Assign(_character.Outfit[AGSOutfit.Walk], 1, 5);
_character.StartAnimation (_character.Outfit[AGSOutfit.Idle].Down);
_character.Hotspot = "Cris";
_character.PixelPerfect(true);
Characters.Cris = _character;
return _character;
}