PDA

View Full Version : ImageControl



kalannar
June 5th, 2015, 23:01
How do you default an image to be display in it? I can do it in a generic control through icon, but doesn't work for image control.

Trenloe
June 5th, 2015, 23:20
You need to source the imagecontrol on an <image> record in the campaign database (or a module). Try using Interface.openWindow("imagewindow", <the DB reference to the image to display>); in a CoreRPG based ruleset. Info on Interface.openWindow here: https://www.fantasygrounds.com/refdoc/Interface.xcp#openWindow

This will give you an idea of the format of the DB source to use - for example it might be image.id-00001 for the first image record in your campaign database.

You have to use database image references from the campaign database or a loaded module, you can't directly specify an image file.

kalannar
June 6th, 2015, 03:54
What I am trying to do is have an image that is part of the extension that allows the player to drop tokens on. I have tried using a generic control and placing the image control over it, but the token placement to the image is not correct when other players are viewing it. Any ideas what i can do instead?

Trenloe
June 6th, 2015, 03:58
I'd suggest looking at the order tab in the party sheet (CoreRPG) - this is a blank image that allows the players to arrange tokens in the marching order, but the GM has to put the tokens on there. I think this will be a good start to get you going...

kalannar
June 7th, 2015, 14:47
I have the image control working, I want a jpg of terrain showing in the background. Can I set a background image to the image control?

Trenloe
June 7th, 2015, 17:31
I have the image control working, I want a jpg of terrain showing in the background. Can I set a background image to the image control?
You can't do this programatically. As I mentioned in post #2 actual image files are stored in the campaign database or a module - they aren't stored in the filesystem, a ruleset or an extension. Thus you can't create a default picture within an image control that would be 100% fool-proof. You could make one in tandem with a module - and access it by <image DB ref>@<module name> but this would rely on that specific module being installed and manually activated by the GM - definitely not fool-proof! Although you could use the Module.activate method to activate the module if it was installed: https://www.fantasygrounds.com/refdoc/Module.xcp#activate

kalannar
June 8th, 2015, 15:14
Ok got it, was hoping there was a way to set the image based of the window the image control inherits. I will just go back to overlaying the image control over a generic control with an image selected. Thank you Trenloe for your help.