Thread: Image rotation?
-
April 14th, 2026, 15:07 #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
-
April 14th, 2026, 15:58 #2
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-importLast 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!
-
April 14th, 2026, 16:30 #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
-
April 14th, 2026, 16:35 #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
-
April 14th, 2026, 16:44 #5
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!
-
April 14th, 2026, 16:53 #6
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).
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
-
April 14th, 2026, 17:19 #7
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!
-
April 14th, 2026, 17:31 #8DISCORD / 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
-
April 14th, 2026, 17:39 #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!
-
April 14th, 2026, 18:09 #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!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)

Reply With Quote


Bookmarks