Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
fr:tutorial:tutorial01 [2016/08/31 13:20] Nicolas Ronvel [Un choix à faire] |
fr:tutorial:tutorial01 [2016/08/31 13:36] Nicolas Ronvel [That's it ?] |
||
---|---|---|---|
Ligne 209: | Ligne 209: | ||
Notre carte est maintenant éditable, et chaque fois qu'une valeur change, l'image générée change en conséquence. Il est temps de passer à l'illustration ! | Notre carte est maintenant éditable, et chaque fois qu'une valeur change, l'image générée change en conséquence. Il est temps de passer à l'illustration ! | ||
- | ===== Mug Shot ===== | + | ===== Photo d'identité ===== |
- | Our Star Player need a photo / illustration to be correctly identified. For this purpose, we'll use an [[..:template:image_input|Image field]]. This type of field allows the user to load an image for each card, image that can then be used on the card. | + | Notre Champion a besoin d'une photo / illustration pour être correctement identifié. Pour cela, nous utiliserons un [[..:template:image_input|Champ Image]]. Ce type de champ permet à l'utilisateur de charger une image pour chaque carte, image qui sera ensuite utilisée dans l'image de la carte. |
- | Right now, the **Image input** control is pretty basic. But it's [[https://github.com/Gulix/geckos/issues/37|planned to evolve]]. Until completion of this Issue, the user has to ensure his image file corresponds, in ratio, to the image frame on the card. Or the image will be stretched. | + | Actuellement, le **Champ Image** est plutôt basique. [[https://github.com/Gulix/geckos/issues/37|Des évolutions sont programmées]]. En attendant le développement de celles-ci, l'utilisateur doit s'assurer que le ratio de l'image qu'il charge correspond au ratio du cadre dans lequel on va l'utiliser. Sinon, l'image sera étirée. |
- | To add the **Image input** field, just add this line to the ''fields'' part of the template : | + | Pour ajouter un **Champ Image**, ajoutons juste cette ligne à la section ''fields'' du template : |
<code javascript> | <code javascript> | ||
Ligne 221: | Ligne 221: | ||
</code> | </code> | ||
- | This field will generate a **$portray** variable, which will contain the image in the form of a DataUrl (remember ?). Just what we need to add an image to our canvas : | + | Ce champ génèrera une variable **$portray**, qui contiendra l'image sous forme de DataUrl (ça ne vous rappelle rien ?). Juste ce dont on a besoin pour notre canvas : |
<code javascript> | <code javascript> | ||
Ligne 227: | Ligne 227: | ||
</code> | </code> | ||
- | Apply those modifications to your template, and then, look ... | + | Modifiez votre template, appliquez les modifications, et admirez ! |
- | {{:en:tutorial:01_ui05.png?500|Nobbla's Mug Shot}} | + | {{:en:tutorial:01_ui05.png?500|Nobbla en chair et en os !}} |
- | ===== Do you have the skills ? ===== | + | ===== Bilan de compétences ===== |
- | Three fields are still missing. Let's start with the easier one. | + | Trois champs manquent encore à l'appel. Commençons avec le plus aisé. |
- | ==== Cost ==== | + | ==== Coût ==== |
- | Each Star Player requires a certain amount of Gold Pieces to be recruited. Let's add an input field that will appear in the bottom of the card. The editable field : | + | Chaque Champion nécessite un certain montant de Pièces d'Or pour être recruté. Ajoutons un champ de texte pour renseigner cette valeur, qui apparaîtra en bas de la carte. |
+ | |||
+ | Dans la partie ''fields'' : | ||
<code javascript> | <code javascript> | ||
Ligne 243: | Ligne 245: | ||
</code> | </code> | ||
- | And the canvas field : | + | Dans la partie ''canvasFields'' : |
<code javascript> | <code javascript> | ||
Ligne 249: | Ligne 251: | ||
</code> | </code> | ||
- | One new thing here is the use of the ''fontStyle'' property in the canvas field. It sets the text to italic. Pretty easy to understand. | + | Première nouveauté, l'utilisation de ''fontStyle'' pour indiquer que le texte sera affiché en italique. Rien de bien compliqué là-dedans. |
- | The other thing is the use of an [[en:template:advanced_string_variables|Advanced String Variable]] with ''$cost$ GP''. It helps us build a more intelligent string, by always adding GP (Gold Pieces) to the cost string the user will use. Of course, it could cause some issues (a Free star player ?). But, again with a translated template in mind, we could easily change this value on the template. Or change the currency (SP for Silver Pieces ?). | + | Autre nouveauté, l'utilisation d'une [[en:template:advanced_string_variables|Variable de chaîne Avancée]] avec ''$cost$ GP''. Cela permet de construire une chaîne plus intelligente, en ajoutant GP (pour Gold Pieces) après le coût indiqué par l'utilisateur. Bien sûr, cela peut entraîner quelques soucis (un Champion gratuit ?). Mais dans le cadre d'une traduction de template, cette valeur sera modifiée facilement. |
- | ==== Multilines ==== | + | ==== A la ligne ==== |
- | The next input field will be a new one : the [[..:template:multiline_text_input|Multiline Text Input]] field. It works like the classic **Text input** field, but allows the user to add line-breaks. We'll add two fields : | + | Nos prochains champs vont utiliser un nouveau type de champ : le [[..:template:multiline_text_input|Champ de texte multiligne]]. Cela fonctionne comme un **Champ Texte** classique, mais l'utilisateur peut y saisir des sauts de ligne. Ajoutons deux champs à notre section ''fields'' du template : |
<code javascript> | <code javascript> | ||
Ligne 262: | Ligne 264: | ||
</code> | </code> | ||
- | We now add two more **textboxes** that will be linked to these two fields : | + | Puis ajoutons les deux **textbox** correspondantes dans ''canvasFields'' : |
<code javascript> | <code javascript> | ||
Ligne 269: | Ligne 271: | ||
</code> | </code> | ||
- | Those fields use an automatic wrapping method : lines that are too long are broken to be displayed on several lines. And the user can still control when the line-breaks occur by setting them himself. | + | Ces champs utilisent un bornage automatique. Si le texte venait à être trop long pour la largeur spécifiée, un saut à la ligne automatique est ajouté. Les sauts de lignes de l'utilisateur, saisis dans le champ éditable, sont évidemment pris en compte également. |
- | + | ===== Et, c'est tout ? ===== | |
- | ===== That's it ? ===== | + | |
- | For this tutorial, yes, that's it. You know have a functional template that allows you to get Star Player cards. Of course, with the help of this tutorial, I encourage you to create your own template for your own needs. I will soon open a place to share the templates, and the demo page will host various templates (when [[https://github.com/Gulix/geckos/issues/30|this issue]] is completed). | + | Pour ce tutoriel, oui, c'est tout. Vous disposez là d'un template fonctionnel pour vos cartes de Champions. Je vous encourage bien sûr à créer vos propres templates à l'aide de ce tutoriel et de cette base. Un espace de partage pour les templates est envisagé pour le futur, et la page de démo hébergera par défaut plusieurs templates ([[https://github.com/Gulix/geckos/issues/30|cette évolution]] doit d'abord être terminée). |
- | If you have any trouble with this tutorial or the software, feel free to ask me for help, via the creation of an [[https://github.com/Gulix/geckos/issues/new|Issue]], or via a message on a forum in which I'll participate. | + | Si vous avez un souci avec ce tutoriel, ou avec le logiciel, n'hésitez pas à demander de l'aide, via la création d'un [[https://github.com/Gulix/geckos/issues/new|ticket d'incident]], ou via un message sur un forum où Geckos est présenté. |
===== Full code of the template ===== | ===== Full code of the template ===== |