Git Product home page Git Product logo

gum's Introduction

Join the chat Twitter

Introduction

Gum is a general purpose UI layout tool built on object-oriented principles.

image

Specifically it supports:

  • Inheritance
  • Object instances
  • Default/overriding variables
  • States (categorized and uncategorized)
  • Incredibly flexible layout engine

Gum exports to human-readable XML, and can be extended either using MEF or by modifying the source code directly.

Tutorials and documentation can be found here:

https://docs.flatredball.com/gum/

Alt

Star Velocity

Sparkline

Need Help?

The fastest way to get help is to ask in our Discord: https://discord.gg/uQSam6w36d

You can also post an issue: https://github.com/vchelaru/Gum/issues

You can also check the docs: https://docs.flatredball.com/gum/

Platforms

Gum produces genera-purpose XML so it is technically possible to use Gum in any environment. That said, a number of runtimes exist to make integration into your project much easier.

Gum integrations exist for the following environments:

  • MonoGame
  • FlatRedBall
  • Meadow
  • SkiaSharp
  • WPF
  • Xamarin.Forms/Maui

For details on integrating Gum with these runtimes, or for using GumCore to integrate with your own runtime, see the main documentation: https://docs.flatredball.com/gum/

gum's People

Contributors

alexnaraghi avatar ansismalins avatar arcnor avatar bicheichane avatar bjorn avatar coldacid avatar dependabot[bot] avatar dubhlaidh avatar j-swift avatar kalldrexx avatar mfigueirido avatar patridge avatar profexorgeek avatar thraka avatar treesgobark avatar vchelaru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gum's Issues

Align to pixels while dragging

I've found an option in the project preferences to align the images to pixels, which I find really useful. However, what I find a little annoying is that it only aligns the object to pixels when you release the mouse. It would be more comfortable if it did this while dragging so you get more immediate feedback.

Maybe related to this, the "RestrictToUnitValue" option seems to not be applied when dragging new things into view, where I see fractional positions appear even at 100% zoom. Of course it's a minor issue since you usually move it afterwards anyway.

Redo

Please implement redo.

Gum should allow ordering of animations

Gum allows you to reorder components, states, etc by using the alt + up/down keys. But this does not work with animations. You should be able to change the order of animations for convenience and organization.

Container alpha / opacity

Using opacity during appear and disappear animations is very common, however it seems to be not possible to do this in Gum except with the visual primitives. There should probably be an alpha or opacity property on the Container that affects its children (recursively).

Allow dropping into parent

@bjorn said:

For initial setup, it would be very nice if you could drop items directly into their parent, rather than setting their parent later via the dropdown.

Of course, visual feedback will need to be given so that the user can pick a suitable drop location.

Skinning system

@bjorn says:

I'm missing explicit support for skins. For most use-cases, I may be able to put a child component at the bottom called "skin" and deal with that in my export script, but our skin system as well as that of Flex has a feature that is not available this way.

This is the ability to define the content area of a component, which affects the layout positions of its children as well as when the children get drawn in relation to other visual parts of the skin. So, you can have a skin that adds a border and decreases the area available for the children, or a skin that adds visuals both behind and in front of the children of the skinned component.

Gum should allow you to swap a state for a different state in an animation

Sometimes you have a state multiple times in an animation or it may appear in multiple animations. But as the project evolves you realize you need one or more new variations on the existing state and replace the old state with the variation in multiple animations. Currently this requires positioning the new varied state identically to the old one, copying its properties, and then deleting the old state.

Instead, you should be able to click a state in an animation and swap it for another state without manually copying values, adding, and deleting states.

Gum w/Glue: No Initialize for mobile platforms

When starting to run the project in glue, on android for instance, get an exception thrown.

"The GumIDB must be initialized with a project file before loading any components/screens. Make sure you have a .gumx project file in your global content, or call StaticInitialize in code first."

If I go to GlobalContent.Generated.cs, I see a code block in Initialize:

if !REQUIRES_PRIMARY_THREAD_LOADING

        DebugFont = FlatRedBallServices.Load<FlatRedBall.Graphics.BitmapFont>(@"content/globalcontent/debugfont.fnt", ContentManagerName);
        FlatRedBall.Gum.GumIdb.StaticInitialize("content/gumproject/gumproject.gumx"); FlatRedBall.Gum.GumIdb.RegisterTypes();  FlatRedBall.Gui.GuiManager.BringsClickedWindowsToFront = false;
        #endif

If I remove the preprocessor directive so the code executes, the issue is resolved. I believe this block needs to be allowed to run for mobile.

Gum w/Glue: Cannot add a gum screen as a runtime object.

  1. Add a gum scene file to a screen.
  2. Create new object -> From File -> GumProject/Screens/TestScreen.gusx -> Source Name = "Entire File (GameplayRuntime)"
  3. Execute application.
  4. Error is thrown: Error 141 Cannot implicitly convert type 'FlatRedBall.Gum.GumIdb' to 'GameProject.GumRuntimes.GameplayRuntime' ...\Screens\TestScreen.Generated.cs
  5. If on step 2, Source Name is changed to "Entire File (GumIdb)", the app seems to generate the same instance variable of type FlatRedBall.Gum.GumIdb. Maybe code is partially being generated for the wrong source file option?

Rectangular selection

Rectangular selection would make it easier to select a group of elements. When Shift is held, a click+drag should always trigger the rectangular selection (overriding the dragging behavior).

Dialog windows should not pop offscreen

When adding an animation, the "name animation" dialog pops off the bottom of the screen (covered by taskbar) when Gum is in fullscreen mode. It should be fully visible.

Demo:
gum-pop-offscreen

Gum should allow canceling component import

If you start to import components and then change your mind, gum imports them anyway but the tree view may not reflect this.

Repro steps:

  1. Have component files somewhere on disk
  2. Right-click component folder in Gum and choose "Import"
  3. Choose your files on disk (not in the gum project folder)
  4. Get notification from Gum with "okay" button only
  5. Click the X on the cancel button
  6. Components are imported anyway
  7. Tree view may not immediately reflect component import

When dragging new instances on a screen, cursor is a "prohibited" (๐Ÿšซ) icon

While following along with the intro tutorial, I added my first item to a screen. While I was dragging around the Text item, the cursor was a prohibited icon which made me think I couldn't place the item anywhere on the screen. When I gave up and released the mouse button, it added just fine, though.

I was kind of expecting some other icon when I was dragging over a valid drop area.

Screenshot showing the Windows cursor when dragging a Text item onto a screen

Gum should allow F2 or double-click to rename a state

Most animation programs support onion-skinning - this allows the animator to see the previous frame while working on a new frame. Gum doesn't need to support full onion-skinning at this point but a very practical animation workflow is to duplicate a state and then adjust it. But it requires six inputs to duplicate a state with a new name:

  1. Right click existing state
  2. Left click Duplicate
  3. Right click new state
  4. Left click rename
  5. Type new name
  6. Press enter or click OK

In addition to being able to quickly copy/paste states, it should also be simpler to rename them. A newly duplicated/pasted state could automatically be focused for rename or at least allow double-clicking the name or pressing F2 to start a rename (the way File Explorer works)

Variable changes are applied to the wrong component

If you edit a variable and right click on another component, the changes to the variable will be applied to the component you right clicked on and not the component you had selected when you changed the variable.

Gum should embed the animation editor in the bottom set of tabs

Popping the animation editor open and closed constantly is very time consuming. It does not remember size and position and the middle pane is always too small to read state names. So it must be adjusted every time it is opened. Additionally, if you have Gum fullscreened you must reposition the Gum window so you can see the animation while also manipulating timings and interpolations.

Most animation programs have the timeline at the bottom and the preview window above it. Gum already has a panel with tabs that include the texture coordinate selection window. The animation editor should be docked in this area as a tab by default. This enables the animator to quickly iterate on timings and interpolations and see the preview without wasting time in window management. The animation editor should also remember column widths.

Gum should see files on disk that are not in the project

It's hard to tell if files exist on disk and aren't in Gum. Gum should either:

  • Work like Visual Studio in that you can view files that are on disk but not in your project
  • Prompt you to add files on disk to your project upon project open
  • Have some special window or dialog that shows you files on disk that are not in Gum

Gum Generates too much JSON noise

I had commit with 102 changed json files due to working a lot in gum. This really pollutes commits with a lot of changed file noise that makes it easy to miss important changes. I examined how this works and here is how I think it should be fixed:

  1. Add an ExportedEventList model that is just a List<ExportedEvent>
  2. Add public DateTime EventDate to the ExportedEvent model
  3. Have the ExportEventFileManager load the ExportedEventList model and insert/delete records into it
  4. You can do all the same stuff you are doing with date times but they will be in the ExportedEvent instead of the file

As far as I understand, this will work the same where Gum is concerned but instead of hundreds of created/deleted files there would just be one file that always lives but it's list contents will change. That may have hundreds of insertions and deletions but they will be on a single file in the commit instead of potentially hundreds.

Gum animation window text should not be distorted

I never saw this in Gum until just recently and I'm wondering if stuff you added from Glue made it start happening. This also happens in the animation editor and in Glue but it never happened in Gum until this morning:

animation-text-distortion

Gum w/Glue: No Initialize for mobile platforms

When starting to run the project in glue, on android for instance, get an exception thrown.

"The GumIDB must be initialized with a project file before loading any components/screens. Make sure you have a .gumx project file in your global content, or call StaticInitialize in code first."

If I go to GlobalContent.Generated.cs, I see a code block in Initialize:

if !REQUIRES_PRIMARY_THREAD_LOADING

        DebugFont = FlatRedBallServices.Load<FlatRedBall.Graphics.BitmapFont>(@"content/globalcontent/debugfont.fnt", ContentManagerName);
        FlatRedBall.Gum.GumIdb.StaticInitialize("content/gumproject/gumproject.gumx"); FlatRedBall.Gum.GumIdb.RegisterTypes();  FlatRedBall.Gui.GuiManager.BringsClickedWindowsToFront = false;
        #endif

If I remove the preprocessor directive so the code executes, the issue is resolved. I believe this block needs to be allowed to run for mobile.

Gum is reacting to file changes in unloaded files

Gum Output console is reacting to files that it should not know about. I was working in one project and copied that project files into a separate gum project and Gum reacted to the file changes.

Repro:

  1. Have a gum project open (Project 1)
  2. Have another gum project on disk (Project 2)
  3. Manually copy/paste files from Project 1 to Project 2 in the windows file explorer, overwriting files with the same name in Project 2
  4. Gum Output console reacts to that change

Screenshot:
image

GumPlugin cannot be installed and loaded correctly

Once I installed the gumplugin and restart Glue, it told me :
8:39:13 - Error trying to load plugins from directory: C:\Users\36011\AppData\Roaming\FRBDK\Plugins\gumplugin/
System.MissingMethodException: Cannot find method:โ€œVoid RenderingLibrary.IPositionedSizedObject.SetParentDirect(RenderingLibrary.IPositionedSizedObject)โ€
Therefore I found the plugin not installed correctly. I can't use it .

Gum should allow editing states while working on an animation

It's impossible to get states right on the first try for any non-trivial animation. The workflow is:

  1. Rough out states
  2. Rough out timings
  3. Iterate on states, timings, and interpolations until correct.

This loop is currently very slow. Once the animation window is embedded in Gum, the user should be able to quickly swap between adjusting animation timings and tweaking states as one smooth workflow without breakages or consequences to their animation

Gum Variables Pane should not be blank

It's possible to get Gum into a state where the entire Variables pane is blank. Here are the repro steps:

  1. Create a container in either a screen or component (both seem to cause this but a screen definitely does)
  2. Put items in the container
  3. Select just the container and copy
  4. Paste the container into the same screen or component
  5. Variables pane goes away

The only way to recover the pane is to close and reopen Gum.

Gum w/Glue: No Initialize for mobile platforms

When starting to run the project in glue, on android for instance, get an exception thrown.

"The GumIDB must be initialized with a project file before loading any components/screens. Make sure you have a .gumx project file in your global content, or call StaticInitialize in code first."

If I go to GlobalContent.Generated.cs, I see a code block in Initialize:

if !REQUIRES_PRIMARY_THREAD_LOADING

        DebugFont = FlatRedBallServices.Load<FlatRedBall.Graphics.BitmapFont>(@"content/globalcontent/debugfont.fnt", ContentManagerName);
        FlatRedBall.Gum.GumIdb.StaticInitialize("content/gumproject/gumproject.gumx"); FlatRedBall.Gum.GumIdb.RegisterTypes();  FlatRedBall.Gui.GuiManager.BringsClickedWindowsToFront = false;
        #endif

If I remove the preprocessor directive so the code executes, the issue is resolved. I believe this block needs to be allowed to run for mobile.

Scaling components

Similar to supporting rotation (#3), it would be nice if components could be scaled.

Usually this would happen in X and Y direction by the same amount, so I think supporting X Scale and Y Scale separately may go a bit far. Yet, this would allow animations that would otherwise not be possible.

Text preview should be the correct font

For some reason Gum is rendering fonts wrong in some cases.

If you don't set a specific state for the text you get a bad preview using some aliased font:
image

But if you specify a state (which in this case specifies a font size) you get the correct (non-aliased) font:
image

Gum should have a smoother animation workflow

The Gum workflow for animation is inefficient. This is what the current workflow looks like:

  1. Create states for a component
    • right click states to duplicate as copy/paste doesn't work
    • right click duplicated state again to rename
  2. Open the animation editor window
    • resize animation editor to see state names because it's always too small
    • resize Gum to make room for the animation editor as a separate window
  3. Add states and adjust timings and interpolations
  4. Decide what edits need to be made to states after roughing in timings
  5. Close animation editor window because you can't edit states while it's open or bad things happen
  6. Repeat process

The constant right clicking to make states, constant opening and closing of editor, constant resizing of editor window, and need to perform these steps in a loop to fine tune animations has a lot of wasted steps. The following things would improve this workflow significantly:

Gum w/Glue: Cannot add a gum screen as an object.

  1. Add a gum scene file to a screen.
  2. Create new object -> From File -> GumProject/Screens/TestScreen.gusx -> Source Name = "Entire File (GameplayRuntime)"
  3. Execute application.
  4. Error is thrown: Error 141 Cannot implicitly convert type 'FlatRedBall.Gum.GumIdb' to 'GameProject.GumRuntimes.GameplayRuntime' ...\Screens\TestScreen.Generated.cs
  5. If on step 2, Source Name is changed to "Entire File (GumIdb)", the app seems to generate the same instance variable of type FlatRedBall.Gum.GumIdb. Maybe code is partially being generated for the wrong source file option?

Rotation

It seems to be currently not possible to rotate components or any of the standard elements. This would be useful in some cases and is required for some animations.

Make framerate configurable (or trigger repaints only when needed)

@bjorn mentioned:

Currently the framerate of the editor is hardcoded on 30. For me this is too low since I want to see a more smooth response while editing. A first solution would be to make the framerate configurable (for example in the project settings, though "user settings" would be more suitable in this case).

Ideally though, the editor would anyway only repaint when necessary. Then, a framerate setting becomes unnecessary since there would be not a general "overhead" introduced by just having the editor open.

Add documentation about how default variables behave in states

If a state explicitly sets a variable then that variable will change in an animation, but it will not interpolate if the other state in an animation does not explicitly set it. This should be called out in a tutorial as it's a pretty critical understanding when making animations.

Gum animations should not apply timings to the wrong state

There's a bug that I can't specifically repro but it goes something like this:

  • Create a gum animation with several states
  • Add a named event (maybe do this a couple of times)
  • The named event will appear to be selected
  • Change the value in the Time input
  • Nothing happens
  • Click off of the new named event and back onto it
  • Change the value in the Time input
  • The time value is applied to the named event
  • Realize that the first value you entered was applied to some other state

This is a big problem because it messes up your carefully-timed animation but you may not realize it for awhile. Then you have to try to figure out which state got messed up and what it was supposed to be.

Gum should not allow you to drag an item onto itself

Repro steps:

  • Create a container
  • Put items (sprites or whatever) in the container
  • Drag the container and drop it onto itself
  • Gum clones the container items into the continer

Expected behavior: There's no way to cancel an accidental drag. Expectation is that I can cancel a drag by just "putting the item back" where it can from (releasing onto itself).
Actual behavior: Gum clones the entire object into itself as a duplicate. Since copy/paste exists there's no reason to have this duplication behavior.

Project is saved when it is opened

I guess it's a measure to upgrade files to any new format changes, but this happens even when there are no changes to save. This behavior wreaks havoc with Perforce. Gum should only save when it makes sense.

XamlParseException occurs when selecting Text / ColoredRectangle

I'm trying to run the latest master in Visual Studio 2015, but I'm getting the following exception as soon as I place a Text or ColoredRectangle and select it:

System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  LineNumber=20
  LinePosition=68
  Message='Initialization of 'Xceed.Wpf.Toolkit.ColorPicker' threw an exception.' Line number '20' and line position '68'.
  Source=PresentationFramework
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Gum.Controls.DataUi.ColorDisplay.InitializeComponent() in D:\project\closingkit\trunk\tools\Gum\Gum\Gum\Controls\ColorDisplay.xaml:line 1
  InnerException: 
       HResult=-2146233088
       LineNumber=0
       LinePosition=0
       Message=Initialization of 'Xceed.Wpf.Toolkit.Core.VersionResourceDictionary' threw an exception.
       Source=System.Xaml
       StackTrace:
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
            at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
            at System.Xaml.XamlObjectWriter.Logic_EndInit(ObjectWriterContext ctx)
            at System.Xaml.XamlObjectWriter.WriteEndObject()
            at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
            at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
            at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter)
            at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
            at System.Windows.SystemResources.ResourceDictionaries.LoadThemedDictionary(Boolean isTraceEnabled)
            at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
            at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
            at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
            at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
            at System.Windows.FrameworkElement.OnInitialized(EventArgs e)
            at System.Windows.FrameworkElement.TryFireInitialized()
            at System.Windows.FrameworkElement.EndInit()
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
       InnerException: 
            HResult=-2146232800
            Message=Cannot locate resource 'xceed.wpf.toolkit;v2.3.0.0;themes/xceed.wpf.toolkit;v2.3.0.0;component/themes/aero/brushes_normalcolor.xaml'.
            Source=PresentationFramework
            StackTrace:
                 at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
                 at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
                 at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
                 at System.IO.Packaging.PackWebResponse.GetResponseStream()
                 at System.IO.Packaging.PackWebResponse.get_ContentType()
                 at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response)
                 at MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType)
                 at System.Windows.ResourceDictionary.set_Source(Uri value)
                 at Xceed.Wpf.Toolkit.Core.VersionResourceDictionary.System.ComponentModel.ISupportInitialize.EndInit()
                 at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
            InnerException: 

I realize it may be a problem with my setup somehow, but right now I have no idea why this is happening. Xceed seems to be missing the resource 'xceed.wpf.toolkit;v2.3.0.0;themes/xceed.wpf.toolkit;v2.3.0.0;component/themes/aero/brushes_normalcolor.xaml'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.