Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GuiDrawingPanel (https://forums.graalonline.com/forums/showthread.php?t=85564)

DustyPorViva 05-14-2009 03:20 AM

GuiDrawingPanel
 
If I create a GuiDrawingPanel, draw some images and THEN resize it, it displays nothing. I've echoed the dimensions and they show the correct size, but it displays absolutely nothing.

Is there a way I can refresh it perhaps after I've resized it or something, or a way to fix this problem?

DustyPorViva 05-15-2009 02:56 AM

No one? This is kind of important :(

Inverness 05-15-2009 08:16 AM

Not a clue.

fowlplay4 05-15-2009 03:00 PM

Well if it shows before you resize it, why don't you just..

PHP Code:

function whateverObj.onResize() {
  
redrawDrawing();
}

function 
redrawDrawing() {
  
// your drawing stuff here



DustyPorViva 05-15-2009 06:34 PM

Well I'm resizing after I draw. Basically what I'm doing is creating a panel with a 32p height for a sign(one light of text), then I start drawing the letters on the panel. Then at the end, I resize it accordingly to how many lines there are. I've tried a few variations, including resizing it after each new line is added(so I'm not adding images into blank areas), resizing BEFORE I add a new line, and just resizing after it's finished generating a sign.

Now, if I fire the weapon(which generates the sign), it shows blank. But if I fire it again without updating the weapon, it displays the sign perfectly.

fowlplay4 05-15-2009 07:10 PM

Can you provide the code or a sample of what you're doing?

I'd like to play around with it and work towards finding a fix for the problem.

DustyPorViva 05-15-2009 07:20 PM

On testbed it's in Public/DustyPorViva/Sign

Admins 05-15-2009 08:45 PM

Drawing panels are made to be fixed size. It even detects updates of images you have drawn into the drawing panel and is drawing again, in the good order. But when resizing the panel the content is lost. Does it need to be of dynamic size or can't you calculate the size before drawing?

DustyPorViva 05-15-2009 08:54 PM

Quote:

Originally Posted by Stefan (Post 1491659)
Drawing panels are made to be fixed size. It even detects updates of images you have drawn into the drawing panel and is drawing again, in the good order. But when resizing the panel the content is lost. Does it need to be of dynamic size or can't you calculate the size before drawing?

Calculating the size before drawing would mean basically twice the workload just to get a predicted size(since it's working with variable sized images and such for the letters being drawn). It's essentially what I'm doing now -- calling the function twice.

fowlplay4 05-15-2009 10:50 PM

Quote:

Originally Posted by DustyPorViva (Post 1491645)
On testbed it's in Public/DustyPorViva/Sign

Don't have access to Testbed :P


All times are GMT +2. The time now is 10:58 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.