1. #1

    How do I get the applications window size (in pixel)?

    Hey all!

    I'd like to make a window that stretches over the complete screen, horizontally. I got it to where I can open my window, fix it to the top left by code, and resize it manually and/or via code. So far so good, but what I can't find, neither in the forums, nor the refdoc (which, btw., could use a search function, for us lazy people ^^), nor the dev guide, is how to find out the current resolution of the Fantasy Grounds window. I'm not talking about my own window, I mean the complete application window.

    I need something like Screen.width in the Unity Engine.

    I've been looking for the sidebar in CoreRPG, which scales horizontal, but I didn't find out how it does that.

  2. #2
    LordEntrails's Avatar
    Join Date
    May 2015
    -7 UTC
    Blog Entries
    Don't know. But the map resize to background/full does what you want right? So perhaps you can find it in there?

    As for RefDoc search, use a Google Search with the site specified?

    Current Projects: Ultimate Undermountain (NYDUM)
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets
    DMsGuild Content: Balance Disturbed (Adventure), Dungeon Room Descriptions
    FG Product Reviews: Virtual Scribe Reviews

  3. #3
    Quote Originally Posted by LordEntrails View Post
    Don't know. But the map resize to background/full does what you want right? So perhaps you can find it in there?
    I'll look into it. Thank you =)

    Quote Originally Posted by LordEntrails View Post
    As for RefDoc search, use a Google Search with the site specified?
    That's why I said "us lazy people"

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Newcastle, UK (for a bit)
    Or, to search the Wiki. From the new Wiki page (accessing from the Help menu at the top of the page) click the magnifying glass in the top left.

    Then search for getsize maybe? And select the result for windowinstance
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    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!

  5. #5
    Got it. You basically put a panel stretching over your whole screen on the desktop, and put an empty class in there, which doesn't do any size or position control on itself. Make sure your panel has the <disabled /> tag, so it doesn't interfere with the rest of the interface.
        <windowclass name="dev_console">
            <nomove />
    			<size width="150" height="100" />
    			<nosave />
    			<minimum width="100" height="25" />
    			<maximum width="10000" height="500" />
    			<dynamic />
        <windowclass name="empty">
    	<panel name="desktopfullpanel" modes="host,client">
    			<left /> 
    			<top />
    			<right />
    			<bottom />
    		<disabled />
    Second, you need a Lua script that hangs onto the onDesktopInit function and sets the size:
    function onInit()
        local dc =Interface.openWindow("dev_console", "");
        Interface.onDesktopInit = onDesktopInit;
    function onDesktopInit ()
        local devCon = Interface.findWindow("dev_console", "");
        local empty = Interface.findWindow("empty", "");
        devCon.setSize(empty.getSize (),25);
    Very basic, and somewhat ugly as far as solutions go, but it works. If you want to I can clean it up, and pack it into an extension. Though, if you devs are reading - I don't know your codebase, I'm a developer myself, I hate such assumptions as well, but... shouldn't that be quite quick and easy to implement? Just another function for the Interface class.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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

Log in

Log in