![]() |
Anchoring Knockoff.
Trying to emulate the anchoring support I asked for.
It appears to be hitting the proper case in switch statement, yet does not set x and y accordingly. Adding debug checks such as "player.chat = this.ANCHOR_TOP[0] - (GControl.width / 2);" give me the position I want, but the x/y always ends up being 0. edit: also not complete, once I get this issue out of the way I'll add x-y offsets as well. PHP Code:
|
picture?
image? screenshot!? |
I fell through every case like a *****. Not scripting in awhile has taken it's toll.
I edited the code with the fixed version. |
Just a comment on the code, you should either use const/enum, or not use the all-caps convention associated with constants when they aren't.
Although, const/enum can be problematic since they just replace the variables at compile-time, so if you do anything dynamic with them it'll fail. An alternative route would be to use a TStaticVar: PHP Code:
|
Your anchors will need to update if the player re-sizes the window, so why bother with those this.anchor.var's at all.
The default needs a break too. |
| All times are GMT +2. The time now is 05:49 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.