DICE PACKS BUNDLE
Page 1 of 5 1 2 3 ... Last

Thread: Image rotation?

  1. #1

    Image rotation?

    Can anyone point me to documentation or examples related to image rotation?

    I've tried several approaches, but no luck so far. This is for an extension where I want to flip some images.

    Thanks!
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    Just For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,716
    There's an angle parameter as part of the layerdata table in Image.addLayer: https://fantasygroundsunity.atlassia...Image#addLayer But this is when you add a layer, not changing an existing layer - depending on what you have on the layer, you may be able to remove then add the layer to effectively change the rotation. I don't know if this can be changed via another (undocumented?) function.

    I do quite a bit with tiles in the FVTT -> Fantasy Grounds extension, you could look at the code in that extension - the addTile function in manager_fvtt2fg.lua is a good place to start. Extension information here: https://www.fantasygrounds.com/forum...-export-import
    Last edited by Trenloe; April 14th, 2026 at 16:01.
    FG Wiki: How to Compile the FG Logs

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Thanks for the response.

    This is for a Tarot card extension (nothing related to the map), currently using a genericcontrol (I've tried tokens, and others) for the card.

    Do your suggestions still apply, or are those more for map layers/tiles?
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    Just For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  4. #4
    The quick way I would approach this is just making sideways images of the cards and set the asset to that card when turned.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,716
    Ah, OK - so you're not using an FG "image" control then, as you mentioned "image rotation" I assumed you were talking about an FG image control. The information I gage was for FG images, which aren't restricted to maps. As I'm not exactly sure how you're approaching this, the information I provided may not be of use to you.
    FG Wiki: How to Compile the FG Logs

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #6
    Quote Originally Posted by superteddy57 View Post
    The quick way I would approach this is just making sideways images of the cards and set the asset to that card when turned.
    That would work for sure. That's the approach I used for my Volvelle extension. But in this case, I have hundreds of card images, and I'm really hoping not to triple the storage needed (one for inverted, one for sideways).

    Quote Originally Posted by Trenloe View Post
    Ah, OK - so you're not using an FG "image" control then, as you mentioned "image rotation" I assumed you were talking about an FG image control. The information I gage was for FG images, which aren't restricted to maps. As I'm not exactly sure how you're approaching this, the information I provided may not be of use to you.
    I've tried some other controls, but not imagecontrol yet - I'll give that a try, thanks!
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    Just For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  7. #7
    Quote Originally Posted by jkeller View Post
    That would work for sure. That's the approach I used for my Volvelle extension. But in this case, I have hundreds of card images, and I'm really hoping not to triple the storage needed (one for inverted, one for sideways).
    Just a question to help without any knowledge in coding:
    Would it be possible to [with some sort of control] that one card image used for all rotations instead of using different card images for face up & sideways, etc?
    Automating some function just like in the map making part of FGU?
    I scribble Solo RPG methods and reviews for Resources in my All Things Solo blog.
    Now with Solo Builds for DnD 5E. And All Solo Modules for FGU WIP.
    LIST OF ALL FREE FGU STUFF
    //Design with Systems, not Custom Solutions!

  8. #8
    Quote Originally Posted by Tempered7 View Post
    Just a question to help without any knowledge in coding:
    Would it be possible to [with some sort of control] that one card image used for all rotations instead of using different card images for face up & sideways, etc?
    Automating some function just like in the map making part of FGU?
    That's what I'm hoping; investigating the imagecontrol now.

    Currently, I have a version that adds a small down-arrow to indicate inversion. That works, it's just not very immersive.
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    Just For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  9. #9
    Good to know. Seems like it's already progressing.
    Right now I am running the deep research and in a few mins, after I check everything, I will make another post of my findings.
    I scribble Solo RPG methods and reviews for Resources in my All Things Solo blog.
    Now with Solo Builds for DnD 5E. And All Solo Modules for FGU WIP.
    LIST OF ALL FREE FGU STUFF
    //Design with Systems, not Custom Solutions!

  10. #10
    Can someone with actual knowledge check this So I can do corrections if necessary?
    It's from a Deep Research of NotebookLM.

    Sorry it took a while.

    Ok, Im not 100% sure on what I've found but these are the ways to use one image per card face and one image for a card back with some controller combo.

    Entire PDF is here.

    Summary

    1. Define the Container

    The foundation of the card display is the genericcontrol, defined in XML. This control acts as a widgetcontainer, providing a base canvas and mounting point for dynamic graphical assets.

    2. Instantiate the Asset

    To display the card, use Lua to create a bitmapwidget within the genericcontrol by calling:

    • addBitmapWidget(asset_name): This function instantiates a single asset (like a card face) as a widget object.

    3. Apply Rotation and Orientation -- PROBLEMATIC PART!!! Check Carl's Post // It kinda worked.

    Orientation is handled programmatically through the setRotation function, which supports floating-point degree values for free rotation.

    • Face-Up (Standard): widget.setRotation(0). Degrees chart.
    • Inverted: widget.setRotation(180).
    • Sideways/Tapped: widget.setRotation(90) or (270).
      • Note: The parent genericcontrol must have a bounding box large enough to accommodate the card’s dimensions when rotated (e.g., a 300x500 card needs a 500x300 footprint when sideways).

    4. Manage Face-Down States

    A single image widget can be manipulated to show different states, or a dual-widget system can be used:

    • Asset Swapping: Call setBitmap("back_asset_name") on the existing widget to switch between the card face and back.
    • Visibility Toggling: Create two widgets (one for the face, one for the back) and use setVisible(boolean) to toggle which is shown.

    5. Handle Stacking and Z-Order

    When arranging cards in spreads or piles, use procedural anchoring to manage overlap and depth:

    • setAnchor(edge, parent, anchor, offset, relation): Defines the relative position of cards.
    • Stacking Logic: Setting the relation parameter to "relative" allows cards to stack or fan out automatically based on the position of the previous card in the list.
    • Z-Order: While XML order determines default drawing, dynamic reordering in a hand requires iterating through the card list and re-applying anchors to ensure the correct visual flow.

    EDIT: RELATED WIKI PAGES FOR EASY ACCESS

    Last edited by Tempered7; April 15th, 2026 at 22:26.
    I scribble Solo RPG methods and reviews for Resources in my All Things Solo blog.
    Now with Solo Builds for DnD 5E. And All Solo Modules for FGU WIP.
    LIST OF ALL FREE FGU STUFF
    //Design with Systems, not Custom Solutions!

Page 1 of 5 1 2 3 ... Last

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Refer a Friend

Log in

Log in