public static ImageModifier CreateFromConfig(ConfigNode node) { ImageModifier imageModifier = null; Type type = Type.INVALID; if (node.HasValue("type")) type = (Type)ConfigNode.ParseEnum(typeof(Type), node.GetValue("type")); switch (type) { case Type.BASE_TEXTURE: imageModifier = IM.BaseTexture.CreateBaseTexture(node); break; case Type.BITMAP_TEXT: imageModifier = new IM.BitmapText(); break; case Type.BITMAP_MONO_DECAL: imageModifier = new IM.BitmapMonoDecal(); break; case Type.BITMAP_COLOR_DECAL: imageModifier = new IM.BitmapColorDecal(); break; default: case Type.INVALID: break; } if (imageModifier == null) Utils.LogError("unknown image modifier"); else { imageModifier._type = type; imageModifier.load(node); } return imageModifier; }
private void drawAvailableModifiers() { _availableModifiersScrollPos = GUILayout.BeginScrollView(_availableModifiersScrollPos, GUI.skin.box, GUILayout.MinWidth(150), GUILayout.ExpandHeight(true)); GUILayout.Label("Add Layer", GUILayout.ExpandWidth(true)); GUILayout.Space(3); if (GUILayout.Button("Color Decal", GUILayout.ExpandWidth(true))) { IM.BitmapColorDecal im = new IM.BitmapColorDecal(); im.setPosition(centrePosition()); im.gui().initialise(this); _imageModifiers.add(im); _remakePreview = true; _selectedModifier = _imageModifiers.modifiers.Count - 1; } if (GUILayout.Button("Mono Decal", GUILayout.ExpandWidth(true))) { IM.BitmapMonoDecal im = new IM.BitmapMonoDecal(); im.setPosition(centrePosition()); im.gui().initialise(this); _imageModifiers.add(im); _remakePreview = true; _selectedModifier = _imageModifiers.modifiers.Count - 1; } if (GUILayout.Button("Bitmap Text", GUILayout.ExpandWidth(true))) { IM.Text im = new IM.BitmapText(); im.setPosition(centrePosition()); im.gui().initialise(this); _imageModifiers.add(im); _remakePreview = true; _selectedModifier = _imageModifiers.modifiers.Count - 1; } GUILayout.EndScrollView(); }
public override ImageModifier clone() { IM.BitmapText im = new IM.BitmapText(); im.copyFromText(this); return im; }
public BitmapTextGui(IM.BitmapText bitmapText) : base(bitmapText) { _imBitmapText = bitmapText; }