Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Ask a simple question, get a simple answer

Post by Drakkan »

how many gifts I will find under the xmas tree this year ?
Breath from the unpromising waters.
Eye of the Atlantis
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Thorham wrote:How can I set the scale of a custom GUI? By default, elements like fonts always have the same size, regardless of the screen resolution. Any way to change this?
I don't think you can scale text, but there are two other things that are useful for that:
1. GraphicsContext.font() can change the typeface between "tiny", "small", "medium", and "large".
2. GraphicsContext.drawParagraph() can draw a string with a specific width, inserting newlines when necessary, and returns the width and height of the resulting text area.

Also, as far as I can tell, the size of GUI elements is determined only by screen height, not width. Width just affects their position.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
TheLastOrder
Posts: 104
Joined: Wed Oct 17, 2012 1:56 am

Re: Ask a simple question, get a simple answer

Post by TheLastOrder »

Question: Any idea about this:
beach_rock_wall_button_01 ????

Tried in editor, without results...
Looked for it in the forum. Nothing :?

Thanks as always, this is a great community ;)
User avatar
Thorham
Posts: 80
Joined: Sat May 04, 2013 5:12 pm

Re: Ask a simple question, get a simple answer

Post by Thorham »

minmay wrote:I don't think you can scale text, but there are two other things that are useful for that:
1. GraphicsContext.font() can change the typeface between "tiny", "small", "medium", and "large".
2. GraphicsContext.drawParagraph() can draw a string with a specific width, inserting newlines when necessary, and returns the width and height of the resulting text area.
Yeah, I was afraid that might be the case. I wanted to change some part of the existing GUI, but it will never look right in all available resolutions now.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Thorham wrote:
minmay wrote:I don't think you can scale text, but there are two other things that are useful for that:
1. GraphicsContext.font() can change the typeface between "tiny", "small", "medium", and "large".
2. GraphicsContext.drawParagraph() can draw a string with a specific width, inserting newlines when necessary, and returns the width and height of the resulting text area.
Yeah, I was afraid that might be the case. I wanted to change some part of the existing GUI, but it will never look right in all available resolutions now.
You can always draw the characters manually with GraphicsContext.drawImage2().
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Thorham
Posts: 80
Joined: Sat May 04, 2013 5:12 pm

Re: Ask a simple question, get a simple answer

Post by Thorham »

minmay wrote:You can always draw the characters manually with GraphicsContext.drawImage2().
Was afraid of that, too :mrgreen: Thanks anyway.

Any way to change the modifiers for spell and weapon damage that characters get from skills? If not, then I know a way around it, but it bloats the script code.
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 »

Ok guys: Simple question; how do I make a new key item. Do I use define object or cloneObject?

Just want some more keys for my dungeon
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Ask a simple question, get a simple answer

Post by NutJob »

Drakkan wrote:how many gifts I will find under the xmas tree this year ?
LOL! Simple enough. 1d4?
User avatar
Slade
Posts: 45
Joined: Tue Oct 21, 2014 6:31 pm

Re: Ask a simple question, get a simple answer

Post by Slade »

Hey! If i use floor_trigger to get some "starting message" to point where you start, or anywhere so how i make it triggers only once? not everytime i go there. Thanks :) (btw im totally noob at lua but good designer ;) )
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Check the box that says "disableSelf".
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply