Tooltip on Stock Items

Game development with Board Game Arena Studio
Post Reply
User avatar
Bids
Posts: 72
Joined: 02 April 2019, 18:10

Tooltip on Stock Items

Post by Bids »

Hi all,
I have had a request from some players to add a tool tip on some special cards in my game when they are in your hand. I'm talking about 1 - 3 cards that can be in your hand out of 60 cards. In my code, these items are stock items.
So my question is: Is it desireable to have a tooltip on stock items? And how do I add a tooltip on them?
Thanks a lot!
User avatar
MGoulet
Posts: 54
Joined: 20 September 2014, 13:17

Re: Tooltip on Stock Items

Post by MGoulet »

hi

Should you add tooltip on stock cards? Most of the game add tooltips on stock items (7 Wonders, Race for the Galaxy, Dungeon Roll, 13 Clues, ...)

Code: Select all

setup: function (gamedatas) {
    // ...
    var stock = new ebg.stock();
    stock.onItemCreate = dojo.hitch(this, function (card_div, card_type_id, card_id) {
        this.addTooltipToCard(card_id, card_type_id);
    });
    stock.onItemDelete = dojo.hitch(this, function (card_div, card_type_id, card_id) {
        this.removeTooltip(card_id);
    });
    // ...
},

Code: Select all

addTooltipToCard: function (div_id, card_type_id) {
    var card = this.gamedatas.card_types[card_type_id];
    var html = this.format_block("jstpl_tooltip_card", {
        name: _(card.name),
        type: _(card.type),
        subtype: _(card.subtype),
        color: _(card.color),
    });
    this.addTooltipHtml(div_id, html, '');
},
Post Reply

Return to “Developers”