public static void Main() { renderer = Pixi.AutoDetectRenderer(Width, Height, new RendererOptions { BackgroundColor = 0x1099bb }); Document.Body.AppendChild(renderer["view"].As <HTMLCanvasElement>()); Textures = new TexturePool(); SceneManager = new SceneManager(); SceneManager.Open <MainMenu>(); Window.RequestAnimationFrame(Animate); }
public Sandbox() { Stage = new Stage(0x00FFFF); Renderer = Pixi.AutoDetectRenderer(1024, 768); Global.document.body.appendChild(Renderer.View); var texture = Texture.FromImage("assets/spacesloth.png"); Sloth = new Sprite(texture); Sloth.Anchor.X = Sloth.Anchor.Y = 0.5f; Sloth.Position.X = 512; Sloth.Position.Y = 384; Stage.AddChild(Sloth); Js.de.requestAnimationFrame(new Action(Render)); }