RPTools.net

Discussion and Support

Skip to content

It is currently Tue May 21, 2013 11:57 am 






Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject: Re: Using Handouts
PostPosted: Thu Oct 20, 2011 11:19 am 
Azhrei wrote:
the_meek has the right of it.

It's even worse than normal HTML, since the Java implementation doesn't support percentages for the width/height attributes on any element. :(

It might be possible to change MT so that a percentage used when creating the frame/dialog could be interpreted by MT, not by the HTML library, but I suspect that would be a losing battle (can't calculate a percentage until the internal size is known and that doesn't happen until after the frame is displayed because that's what triggers the HTML elements to be rendered).


Or wait for JavaFX which has FAR superior HTML support to be added to MapTool which should be in version.next >=1.4.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject: Re: Using Handouts
PostPosted: Thu Oct 20, 2011 11:20 am 
stupid double post....

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Last edited by jfrazierjr on Thu Oct 20, 2011 1:47 pm, edited 1 time in total.

Top
 Profile  
 
 Offline
Giant
 
Joined: Sun Feb 20, 2011 3:14 pm
Posts: 203
 Post subject: Re: Using Handouts
PostPosted: Thu Oct 20, 2011 11:45 am 
Ok, sorry to keep poking at this. But I just tested it on my server (I use a VTT setup) and although the image will pop up on the DM side, the player computer I have connected to the LAN server doesn't see the image.

I'm using the macro you gave me that allows me to select any image and load it without needing to click on the chat link (the chat link method works fine). Is there more code needed for the image to also appear on the player side?

Here is a reminder of the macro I'm talking about:
Code:
[H: abort(input("Image | " + json.toList(getLibProperty("ImageList")) + " | Select image | LIST | VALUE=STRING"))]
[dialog("ImageViewer", "height=800; width=600; temporary=1; input=0; noframe=1"): {   <html><p ALIGN=center><image src="[R: getImage(Image)]" />   }]


Top
 Profile  
 
 Offline
Giant
 
Joined: Fri Aug 01, 2008 8:18 am
Posts: 103
 Post subject: Re: Using Handouts
PostPosted: Thu Oct 20, 2011 12:07 pm 
With that macro, you'd have to give them a button to click on. If you send the macroLink to chat (like in my first example), you can have it pop the dialog up automatically, but you can only open a dialog on the other computers by sending a macroLink to chat. There's some information on the conditions under which the macroLink will auto execute on the macroLink wiki article.


Top
 Profile  
 
 Offline
Giant
 
Joined: Sun Feb 20, 2011 3:14 pm
Posts: 203
 Post subject: Re: Using Handouts
PostPosted: Thu Oct 20, 2011 4:36 pm 
Azhrei wrote:
Or specify only one of width or height and the other will default to be whatever is correct in order for the aspect ratio to be maintained.


I've been trying to do this but either I misunderstand what you mean, or I'm not doing it right.

If you specify the width of images to always be 640 and don't set the height, and then you import an 800x600 image, should it appear as 640x480 so the height maintains its aspect ratio when the width goes from 800 down to 640? Or is that not what you meant?

When I set just the height on my macro to be height=722 and I don't put a width, it sizes the image to 722 but it still keeps the original width (so the image skews). It does not scale the width down to keep the aspect ratio correct. Sorry if I misunderstood what you meant.

Even if that was possible, I guess it would only be helpful for larger images since it would scale smaller images up and make them pixalized.

Here is my code:

Code:
[H: abort(input("Image | " + json.toList(getLibProperty("ImageList")) + " | Select image | LIST | VALUE=STRING"))]
[dialog("ImageViewer", "height=750; width=1340; temporary=1; input=0; noframe=1"): {   <html><center><image src="[R: getImage(Image)]"height=722>   }]


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 11622
Location: Tampa, FL
 Post subject: Re: Using Handouts
PostPosted: Fri Oct 21, 2011 12:58 am 
Oryan77 wrote:
When I set just the height on my macro to be height=722 and I don't put a width, it sizes the image to 722 but it still keeps the original width (so the image skews). It does not scale the width down to keep the aspect ratio correct. Sorry if I misunderstood what you meant.

No, you understood me. If it's not doing that then there may be a bug in that regard. I'll make a note.

Quote:
Even if that was possible, I guess it would only be helpful for larger images since it would scale smaller images up and make them pixalized.

Quote:
Here is my code:

Wow, that's weird. There is no such HTML element as <image>. But that actually displays an image? The height in that element should be in quotes, so it should be height="722" but I know the Java HTML is pretty lenient about such things so I don't think that's really the problem.

I'll read up on this and make sure I didn't take a normal HTML feature and just assume it works in the Java implementation (that might be why it's not working for you). It'll be late Friday before I've had a chance to check this, at the earliest.

_________________
Interested in Time Magazine's Best Invention of 2008 Unix-powered laptop? No crashes or lockups. In fact, that series of articles has two such machines. The other is a Dell netbook. :)


Top
 Profile  
 
 Offline
Giant
 
Joined: Sun Feb 20, 2011 3:14 pm
Posts: 203
 Post subject: Re: Using Handouts
PostPosted: Fri Oct 21, 2011 2:54 am 
Azhrei wrote:
There is no such HTML element as <image>. But that actually displays an image? The height in that element should be in quotes, so it should be height="722" but I know the Java HTML is pretty lenient about such things so I don't think that's really the problem.


Yeah, the macro works just fine other than the image still skewing when only the height is set. Images load and I can change the height without using the quotes.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject: Re: Using Handouts
PostPosted: Fri Oct 21, 2011 6:52 am 
Oryan77 wrote:
Azhrei wrote:
There is no such HTML element as <image>. But that actually displays an image? The height in that element should be in quotes, so it should be height="722" but I know the Java HTML is pretty lenient about such things so I don't think that's really the problem.


Yeah, the macro works just fine other than the image still skewing when only the height is set. Images load and I can change the height without using the quotes.


Welll... even if "<image" works, it would be WELL worth your time to make it the correct tag "<img>". When MapTool switches out the UI rendering toolkit for something that supports a more up to date html standard, we have no idea what the behavior will be which could range from working just fine(doubtful) to totally broken in a very bad way. Why not just fix it now instead of having to fix it later when you won't remember WHY it might be broken if it breaks...

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Giant
 
Joined: Sun Feb 20, 2011 3:14 pm
Posts: 203
 Post subject: Re: Using Handouts
PostPosted: Fri Oct 21, 2011 5:18 pm 
jfrazierjr wrote:
Why not just fix it now instead of having to fix it later when you won't remember WHY it might be broken if it breaks...


Ok, I changed the html image to just img. There are other parts in this code that says image. Does this code contain java script and html script all in the same code? Is that what is going on here? I'm trying to make sense of this stuff. Can you check this code to make sure I changed the only area that needed to be changed to img?

ViewImage macro
Code:
[dialog("ImageViewer", "height=750; width=1340; temporary=1; input=0; noframe=1"): {   <html><center><img src="[R: getImage(macro.args)]">   }]


SendLink macro
Code:
[H: abort(input("Image | " + json.toList(getLibProperty("ImageList")) + " | Select image | LIST | VALUE=STRING"))]
[R: broadcast(macroLink("Click to view " + Image + "...", "ViewImage@" + getMacroLocation(), "none", Image))]


When I send the image link to a player side, the player does not need to actually click the link. The image pops up automatically. I'm curious, what part of the code tells it to open the link automatically and why does the DM still need to click the link in the chat instead of it opening up automatically for him also?


Top
 Profile  
 
 Offline
Giant
 
Joined: Fri Aug 01, 2008 8:18 am
Posts: 103
 Post subject: Re: Using Handouts
PostPosted: Fri Oct 21, 2011 6:15 pm 
That looks right. The <image> thing is strange. It looks like I spaced when I wrote that macro and it worked anyway. It doesn't even look like that's deprecated HTML, so that's all on Java?

It's all MapTool rolls and functions. With [dialog:], you use HTML between the curly braces to construct what is displayed. There's no JavaScript available in MapTool, though I believe there are plans for that in future versions.

macroLink has a section that describes the conditions under which a macroLink will execute automatically when sent to chat.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman