Token image display questions.

Progress reports and musings from the developers on the current gaming tools.

Moderators: dorpond, trevor, Azhrei

Post Reply
Jeriah
Kobold
Posts: 2
Joined: Thu May 10, 2012 9:08 pm

Token image display questions.

Post by Jeriah »

I've been using MapTool for awhile. I'm taking some coding classes at uni, and we're doing java at the moment. So, I've started going through the MT source code, and I can't for the life of me figure out how MT handles images and displaying them. I get the MD5 references, but the actual image handlers seem to escape me. If someone could point me in the right direction, I'm really interested in learning more that I can use in the future when I get some more experience.

If this is the wrong forum, I apologize.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Token image display questions.

Post by Azhrei »

If you have specific questions, I'll try to answer them.

In general, look for class whose names start with Image and/or Asset. For example, AssetManager keeps track of which assets are loaded and which need to be read from the assetcache. You can most easily see this by looking in the rplib project (a separate project from MapTool) and looking for the code that loads tokens or other images from external files, such as loadToken().

The ImageManager is more low-level and tends to handle image conversion to formats that are faster or easier for the JVM to work with, such as converting JPEGs into BufferedImage objects.

I think I've got those two right. I didn't write the code, I inherited it ;), so I could have them backwards.

Jeriah
Kobold
Posts: 2
Joined: Thu May 10, 2012 9:08 pm

Re: Token image display questions.

Post by Jeriah »

Thanks! The rplib part was what I was trying to find. I don't fully understand everything it's doing, but that at least puts me where I can start learning this stuff better.

Post Reply

Return to “Developer Notes”