public override void DrawActor(KthuraActor obj, int ix = 0, int iy = 0, int scrollx = 0, int scrolly = 0) { var tx = GetTex(obj); if (tx != null) { obj.UpdateMoves(); TQMG.Color((byte)obj.R, (byte)obj.G, (byte)obj.B); //TQMG.SetAlphaFloat((float)obj.Alpha1000 / 1000); TQMG.SetAlpha((byte)obj.Alpha255); //TQMG.RotateRAD((float)obj.RotationRadians); TQMG.RotateDEG(obj.RotationDegrees); TQMG.Scale(obj.ScaleX, obj.ScaleY); if (obj.AnimFrame >= tx.Frames) { obj.AnimFrame = 0; } tx.XDraw(obj.x + ix - scrollx, obj.y + iy - scrolly, obj.AnimFrame); TQMG.Scale(1000, 1000); TQMG.RotateRAD(0); TQMG.SetAlpha(255); } else { CrashOnNoTex?.Invoke($"Actor-texture '{obj.Texture}' did somehow not load?"); } }
public void SpawnCoords(int ID, string acttag, int x, int y) { try { var L = KMaps[ID].Layers[Layers[ID]]; if (L.HasTag(acttag)) { Kill(ID, acttag); } var A = KthuraActor.Spawn(L, x, y); if (A == null) { throw new Exception($"Cannot spawn actor on coordinate ({x},{y})"); } A.Tag = acttag; } catch (Exception DonaldTrump) { SBubble.MyError($"<MAP #{ID}>.Actor.{acttag}.Spawn({x},{y}):", DonaldTrump.Message, LuaTrace); } }
public void Spawn(int ID, string acttag, string exitpoint) { try { if (!KMaps[ID].Layers.ContainsKey(Layers[ID])) { throw new Exception($"I cannot contact spawn on non-existent layer {Layers[ID]}"); } var L = KMaps[ID].Layers[Layers[ID]]; if (L.HasTag(acttag)) { Kill(ID, acttag); } var A = KthuraActor.Spawn(L, exitpoint); if (A == null) { throw new Exception($"Cannot spawn actor on non-existent spot {exitpoint}"); } A.Tag = acttag; } catch (Exception DonaldTrump) { SBubble.MyError($"<MAP #{ID}>.Actor.{acttag}.Spawn(\"{exitpoint}\"):", DonaldTrump.Message, LuaTrace); } }
abstract public void DrawActor(KthuraActor obj, int ix = 0, int iy = 0, int scrollx = 0, int scrolly = 0);
public override void DrawActor(KthuraActor obj, int ix = 0, int iy = 0, int scrollx = 0, int scrolly = 0) { }