Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   findImg, style, and a loop (https://forums.graalonline.com/forums/showthread.php?t=134256644)

cbk1994 10-24-2009 03:17 PM

findImg, style, and a loop
 
I'm rewriting Era's nickname system, and the code I'm using the show the nickname is:

PHP Code:

  with (findImg(i)) {
    
nick_x;
    
nick_y;
    
    
layer 1;
    
zoom thiso.nickZoom;
    
    
text nick;
    
textshadow true;
    
shadowcolor obj.tmp.nick_shadow;
    
    
font $pref::graal::defaultfontname;
    
style "bc";
  } 

However, the problem is that it will display the style as "bc" (bold and centered) for the first frame (0.05 second loop), then after that, it will always act as if no style is set (not bold, not centered). If I only run the first frame, it will stay bold and centered.

I've found I can place hideimg(i) before re-showing the image, but I'd like to avoid this as it shouldn't be needed.

This code, however, works flawlessly:

PHP Code:

  showText(inick_xnick_y$pref::graal::defaultfontname"bc"nick); 

Help?

Programmer 10-24-2009 03:36 PM

Try this perhaps: Replace 'style', 'text', and 'font' with this:

PHP Code:

code $pref::graal::defaultfontname "@bc@" text

I haven't tested it, but I believe that showText still uses code to display itself.

cbk1994 10-24-2009 03:52 PM

I just found the problem, it was, of course, my fault :noob:.

I misspelled $pref::graal::defaultfontsize when doing

PHP Code:

this.nickZoom $pref::graal::defaultfontsize 24

which was causing it to try to show at 0 zoom (it capped at like .1 or so) and apparently caused some other problems. It's working now.

Oops, thanks anyway, though <3.


All times are GMT +2. The time now is 11:24 AM.

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