public override void InitApp() { Img1 = new Tex2D("Data/ship1.png", true); fx = new FXLitImage(); G1 = new SceneGraph(); S1 = new GraphSprite("Data/ship1.png", 128, 128); var t1 = new Tex2D("Data/tile1.jpg"); for (int y = 0; y < 32; y++) { for (int x = 0; x < 32; x++) { var ns = new GraphSprite(t1, 128, 128); G1.Add(ns); ns.X = -(128 * 16) + x * 128; ns.Y = -(128 * 16) + y * 128; ns.Z = 1.0f; } } G1.Add(S1); S1.X = 0; S1.Y = 0; // G1.X = -16 * 32; // G1.Y = 16 * 32; S1.X = 0; S1.Y = 0; S1.Z = 1.3f; // G1.Add(S1); var rnd = new Random(); for (int i = 0; i < 25; i++) { var ns = new GraphSprite(S1.ImgFrame, 128, 128); ns.X = rnd.Next(-500, 500); ns.Y = rnd.Next(-500, 500); ns.Z = 0.1f + (float)rnd.NextDouble() * 3; // G1.Add(ns); } l1 = new GraphLight() { Range = 650, X = -100, Y = -100, Diffuse = new Vector3(0.4f, 1, 0.5f) }; l2 = new GraphLight() { Range = 640, X = 0, Y = 0, Diffuse = new Vector3(1.8f, 1.2f, 1.2f) }; G1.X = 0; G1.Y = 0; G1.Add(l1); l2.X = 300; VisualFX.Init(); PS1 = new VFXParticleSystem(); VisualFX.Add(PS1); VisualFX.Graph = G1; Part1 = new Tex2D("Data/part1.png", true); // var b1 = new var b1 = new SoftParticle(Part1); b1.XDrag = 0.95f; b1.YDrag = 0.95f; b1.ZDrag = 0.95f; b1.RDrag = 0.95f; PS1.XIJit = 5; PS1.YIJit = 2; PS1.PowerSmall = 1; PS1.PowerBig = 5; PS1.AddBase(b1); }
public void LoadTexs(string folder, string name) { TCol = new Tex2D(folder + "//" + name + "_c.png", false); TNorm = new Tex2D(folder + "//" + name + "_n.png", false); }
public Tile(string imagePath) { ImagePath = imagePath; ColorImage = new Tex2D(imagePath, true); Name = "Tile"; }
public Tile(Tex2D tex) { ColorImage = tex; Name = "Tile"; }
public static void Blit(Tex2D toRendertarget, Material material) { NativeAPI.render_blit(toRendertarget._texInst, material._materialInst); }
public static void SetSkytex(Tex2D skyTexture, bool showSky = true) { NativeAPI.render_set_skytex(skyTexture._texInst, showSky?1:0); }