Gulix / geckos

An online Card Editor with Templates
http://gulix.github.io/geckos/
Other
48 stars 18 forks source link

Options fields with images as options #41

Closed Gulix closed 8 years ago

Gulix commented 8 years ago

A "List image" field, which text value is an image (dataurl).

Gulix commented 8 years ago

Look at this plugin : http://designwithpc.com/Plugins/ddSlick#demo

Also, any modifications to this element should be related to Issue #39

Gulix commented 8 years ago

The Options field has now to variants : the classic one, and ddslick when adding images / miniatures. To add an image / miniature to an option :

{ "name": "characterType", "label": "Type", "type": "options", "default": "leader", "options":
      [
        { "option": "leader", "text": "Leader", "image": "data:image/png;base64,iVBORw......==" },
        { "option": "sidekick", "text": "Sidekick", "miniature": "data:image/png;base64,iVBORw.....==", "image": "data:image/png;base64,iVBORw.....g==" },
        { "option": "ally", "text": "Ally" },
        { "option": "follower", "text": "Follower" },
        { "option": "terror", "text": "Terror" },
        { "option": "gang", "text": "Gang" }
      ]
},

image and miniature fields are optional. The $field.image$ and $field.miniature$ accessors have also been added.

Need to be added to documentation before closing Issue.

Gulix commented 8 years ago

Documentation added in wiki : https://github.com/Gulix/geckos/wiki/Templates-Choice-input https://github.com/Gulix/geckos/wiki/Canvas-Advanced-String-Variables