Example #1
0
 public static Texture2DWithPos ToTexture2D(this BitmapWithPos bitmapWithPos, GraphicsDevice graphicsDevice)
 {
     Texture2DWithPos texture = new Texture2DWithPos(bitmapWithPos.bitmap.CloneFix(), graphicsDevice);
     texture.Position = bitmapWithPos.Position;
     texture.name = bitmapWithPos.name;
     texture.projectedOnto.AddRange(bitmapWithPos.projectedOnto);
     return texture;
 }
 public void enterTextureProjectionMode(Texture2DWithPos textureToProjectDown)
 {
     textureProjectionControl.enterTextureProjectionMode(textureToProjectDown);
     EditingMode = EditingMode.TextureProjection;
 }
 public Texture2DWithDoublePos(Texture2DWithPos t)
 {
     this.t = t;
 }
 internal void enterTextureProjectionMode(Texture2DWithPos textureToProjectDown)
 {
     textureBeingProjectedDown = textureToProjectDown;
 }
Example #5
0
        private void importImage(string fileName)
        {
            lastImportedTextureOffset = lastImportedTextureOffset.Add(20, 20);

            Texture2DWithPos tex;
            using (Stream fileStream = new FileStream(fileName, FileMode.Open))
            {
                tex = new Texture2DWithPos(new SD.Bitmap(fileStream), GraphicsDevice, fileName);
            }
            tex.Position = lastImportedTextureOffset;

            blockViewWrapperControl.EditingMode = EditingMode.Texture;
            foreach (Texture2DWithPos existingTex in((IEnumerable<Animation>)ModelManager.Animations).GetAllTextures())
            {
                if (existingTex.name == tex.name && existingTex.OriginalPath != tex.OriginalPath)
                {
                    MessageBox.Show("Texture relative path name collision: '"+tex.name+
                        "', while original path name was not the same: '"+tex.OriginalPath+
                        "'!", "It should be possible to click on a texture and "+
                        "specify it's name.\nMake such a box popup here!");
                    return;
                }
            }
            ModelManager.SelectedFrame.Images.AddToFront(tex);
        }