public async Task <IObject> GetHotspotAsync(string maskPath, string hotspot, string [] sayWhenLook = null, string [] sayWhenInteract = null, string id = null) { _maskLoader = _maskLoader ?? _resolver.Container.Resolve <IMaskLoader>(); IMask mask = await _maskLoader.LoadAsync(maskPath, debugDrawColor : Colors.White, id : id ?? hotspot); if (mask == null) { return(new AGSObject(id ?? hotspot, _resolver)); } setMask(mask, hotspot, sayWhenLook, sayWhenInteract); return(mask.DebugDraw); }
public IObject GetHotspot(string maskPath, string hotspot, IRoom room = null, string[] sayWhenLook = null, string[] sayWhenInteract = null, string id = null) { _maskLoader = _maskLoader ?? _resolver.Container.Resolve <IMaskLoader>(); IMask mask = _maskLoader.Load(maskPath, debugDrawColor: Colors.White, id: id ?? hotspot); if (mask == null) { return(newAdventureObject(id ?? hotspot)); } setMask(mask, hotspot, room, sayWhenLook, sayWhenInteract); return(mask.DebugDraw); }
public IObject GetHotspot(string maskPath, string hotspot, string[] sayWhenLook = null, string[] sayWhenInteract = null, string id = null) { IMaskLoader maskLoader = _resolver.Resolve <IMaskLoader>(); IMask mask = maskLoader.Load(maskPath, debugDrawColor: Colors.White, id: id ?? hotspot); if (mask == null) { return(new AGSObject(id ?? hotspot, _resolver.Resolve <Resolver>())); } setMask(mask, hotspot, sayWhenLook, sayWhenInteract); return(mask.DebugDraw); }
public async Task <IObject> GetHotspotAsync(string maskPath, string hotspot, IRoom room = null, string[] sayWhenLook = null, string[] sayWhenInteract = null, string id = null) { id = id ?? $"{hotspot} {maskPath}"; _maskLoader = _maskLoader ?? _resolver.Container.Resolve <IMaskLoader>(); IMask mask = await _maskLoader.LoadAsync(maskPath, debugDrawColor : Colors.White, id : id); if (mask == null) { return(newAdventureObject(id)); } setMask(mask, hotspot, room, sayWhenLook, sayWhenInteract); return(mask.DebugDraw); }
public AGSSprite (Resolver resolver, IMaskLoader maskLoader) { _maskLoader = maskLoader; _resolver = resolver; //todo: abstract it to the constructor _translate = new AGSTranslate(); _hasImage = new AGSHasImage(); _hasImage.Anchor = new PointF(); _rotate = new AGSRotate(); ScaleX = 1; ScaleY = 1; _hasImage.OnImageChanged.Subscribe((sender, args) => ScaleBy(ScaleX, ScaleY)); }
public AGSSprite(Resolver resolver, IMaskLoader maskLoader) { _maskLoader = maskLoader; _resolver = resolver; OnScaleChanged = new AGSEvent <AGSEventArgs>(); //todo: abstract it to the constructor _translate = new AGSTranslate(); _hasImage = new AGSHasImage(); _hasImage.Anchor = new PointF(); _rotate = new AGSRotate(); ScaleX = 1; ScaleY = 1; _hasImage.OnImageChanged.Subscribe((sender, args) => ScaleBy(ScaleX, ScaleY)); }
public AGSSprite(Resolver resolver, IMaskLoader maskLoader) { _id = Interlocked.Increment(ref _lastId); _maskLoader = maskLoader; _resolver = resolver; //todo: abstract it to the constructor _translate = new AGSTranslate(); _hasImage = new AGSHasImage(); _hasImage.Pivot = new PointF(); _scale = new AGSScale(_hasImage); _rotate = new AGSRotate(); _scale.PropertyChanged += onPropertyChanged; _hasImage.PropertyChanged += onPropertyChanged; _translate.PropertyChanged += onPropertyChanged; }
public AGSSprite(Resolver resolver, IMaskLoader maskLoader) { _id = Interlocked.Increment(ref _lastId); _pixelPerfectArea = new Lazy <IArea>(generatePixelPerfectArea); _maskLoader = maskLoader; _resolver = resolver; //todo: abstract it to the constructor _translate = new AGSTranslate(); _hasImage = new AGSHasImage(); _hasImage.Pivot = new PointF(); _scale = new AGSScale(); AGSScale.BindSizeToImage(_hasImage, _scale); _rotate = new AGSRotate(); _scale.PropertyChanged += onPropertyChanged; _hasImage.PropertyChanged += onPropertyChanged; _translate.PropertyChanged += onPropertyChanged; }