public void Load(AtlasPage page, String path)
 {
     Texture texture = new Texture(path, false);
     page.rendererObject = texture;
     page.width = texture.Width;
     page.height = texture.Height;
 }
Beispiel #2
0
 public SubImage(Texture tex, int x, int y, int Width, int Height)
 {
     this.texture = tex;
     this.Width = Width;
     this.Height = Height;
     this.Xoffset = x;
     this.Yoffset = y;
 }
Beispiel #3
0
 public static void AddTexture(Texture nettex)
 {
     if (!Exists(nettex.Name)) {
         TextureList.Add(nettex);
     } else {
         Texture oldtex = GetTexture(nettex.Name);
         oldtex.Image = nettex.Image;
     }
 }
Beispiel #4
0
 public TileSheet(Texture tex, int TileWidth, int TileHeight)
 {
     this.Texture = tex;
     this.TileWidth = TileWidth;
     this.TileHeight = TileHeight;
     this.HOffset = 0;
     this.VOffset = 0;
     this.HSeparation = 0;
     this.VSeparation = 0;
 }
 public PlayerCursor(int playernumber, CursorPosition pos, ControlSet contr, string tokenloc, string slotloc, Vector2 corner)
 {
     this.Position = pos;
     this.control = contr;
     Token = new Texture(tokenloc);
     Slot = new Texture(slotloc, false);
     this.Corner = corner;
     this.PlayerNumber = playernumber;
     State = CursorState.PokemonSelect;
 }
Beispiel #6
0
 static Textures()
 {
     if (Game.Render) {
         ErrorTexture = new Texture(@"Data\Error.png");
         FSErrorTexture = new FSTexture();
         FSErrorTexture.ID = Guid.Empty;
         FSErrorTexture.Load(ErrorTexture.Image);
     } else {
         ErrorTexture = null;
     }
 }
Beispiel #7
0
 internal byte[] GetBytes(Texture texture)
 {
     ImageConverter converter = new ImageConverter();
     return (byte[])converter.ConvertTo(texture.Image, typeof(byte[]));
 }
Beispiel #8
0
 public LEDShader()
     : base(File.ReadAllText(@"media\LEDShader\billboard1.vert"), File.ReadAllText(@"media\LEDShader\LED.frag"))
 {
     Tex = new Texture(@"media\LEDShader\laughing_man.jpg");
 }
 public PokemonMoveInfo(string Displayname, string Imagelocation)
 {
     this.Name = Displayname;
     this.Image = new Texture(Imagelocation, false);
 }
Beispiel #10
0
        private static void AddTexture(string filename, string name)
        {
            Texture tex = new Texture(filename);
            tex.Name = name;

            TextureList.Add(tex);
        }
Beispiel #11
0
        public void SetUniforms(Vector3 pos)
        {
            texture = Tex;
            map = Bump;

            ambientColor = new Vector3(1, 1, 1);
            diffuseColor = new Vector3(1, 1, 1);
            specularColor = new Vector3(1, 1, 1);

            shininess = 1;
            scale = 1;
            shadow = 1;
        }
Beispiel #12
0
 public IronTexture(Texture texture)
 {
     this.Texture = texture;
 }
        /// <summary>
        /// Loads a texture and adds it to this arena's list of used/referenced textures.
        /// These textures are then used to draw blocks.
        /// </summary>
        /// <param name="name">The name that will be used to bind a block entity to this texture.</param>
        /// <param name="path">The path at which to locate the texture (GLIMP-convention).</param>
        /// <param name="linearInterpolate">True to enable linear interpolating for this texture, false otherwise.</param>
        /// <returns>true if the operation completed successfully, false otherwise.</returns>
        public bool LoadTexture(string name, string path, bool linearInterpolate)
        {
            Texture tex;

            try
            {
                tex = new Texture(path, linearInterpolate);
            }
            catch(Exception ex)
            {
                Console.WriteLine("LoadableBattleArena.LoadTexture: Failed to load Texture \"" + name + "\" from path \"" + path + "\": " + ex.Message);
                return false;
            }

            Textures.Add(name, tex);
            return true;
        }
Beispiel #14
0
 public SteepParalaxShader()
     : base(File.ReadAllText(@"media\LEDShader\steepparalax.vert"), File.ReadAllText(@"media\LEDShader\steepparalax.frag"))
 {
     Tex = new Texture(@"media\LEDShader\collage.jpg");
     Bump = new Texture(@"media\LEDShader\collage-bump.jpg");
 }
 public static void DrawRectangle(double x, double y, double width, double height, Texture Texture)
 {
     DrawRectangle(new Vector2d(x, y), new Vector2d(x + width, y + height), Texture);
 }
 public static void DrawRectangle(Vector2d p1, Vector2d p2, Texture Texture)
 {
     SetColor(Color.White);
     GL.Enable(EnableCap.Texture2D);
     GL.BindTexture(TextureTarget.Texture2D, Texture.ID);
     GL.Begin(PrimitiveType.Quads);
     GL.TexCoord2(0, 0); GL.Vertex2(p1.X, p1.Y);
     GL.TexCoord2(1, 0); GL.Vertex2(p2.X, p1.Y);
     GL.TexCoord2(1, 1); GL.Vertex2(p2.X, p2.Y);
     GL.TexCoord2(0, 1); GL.Vertex2(p1.X, p2.Y);
     GL.End();
 }
Beispiel #17
0
 public void Load(Bitmap img)
 {
     this.Texture = new Texture(img, this.Name, 0, 0);
 }
Beispiel #18
0
 //Texture
 public void SetUniform(string name, Texture value, int slot)
 {
     int loc = GL.GetUniformLocation(iProgram, name);
     GL.ActiveTexture(TextureUnit.Texture0 + slot);
     GL.BindTexture(TextureTarget.Texture2D, value.ID);
     GL.Uniform1(loc, slot);
     GL.ActiveTexture(TextureUnit.Texture0);
 }
 public static void DrawQuad(Vector3d p1, Vector3d p2, Vector3d p3, Vector3d p4, Texture Texture)
 {
     SetTexture(Texture);
     DrawQuad(p1, p2, p3, p4);
 }
 //Set Texture
 public static void SetTexture(Texture Texture)
 {
     SetColor(Color.White);
     GL.BindTexture(TextureTarget.Texture2D, Texture.ID);
 }
Beispiel #21
0
 public static IronTexture GetTexture(string name)
 {
     if (Textures.ContainsKey(name)) {
         return new IronTexture(Textures[name]);
     } else {
         Texture tex = new Texture(GraphicsManager.GetError(), false);
         Textures[name] = tex;
         new Networking.Texture.Add(name).Send();
         return new IronTexture(tex);
     }
 }