bug in RenderText.TextFloatRef or RenderTransform.Translate

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
nmarshall
Posts: 14
Joined: Wed Mar 14, 2007 11:59 pm
Location: Los Angeles, California

bug in RenderText.TextFloatRef or RenderTransform.Translate

Post by nmarshall »

This was an odd bug I saw when I was putting together a coordinate test program. I attached the file below.

Under States - ViewModelCoord : AppState - OnRender - CirclingCoordinate : Group - Children - ShowX : RenderText in the TextFloatRef field I entered MovePoint.Translate.X. When I click off that object and back on it shows just MovePoint.Translate.

Similarly in the ShowY : RenderText object I entered MovePoint.Translate.Y and when I click off and back on it shows MovePoint.Translate.1.

Nick
Attachments
CoordinateTest.zgeproj
(3.16 KiB) Downloaded 576 times
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

You have found a bug! It is only cosmetic since the program works, but it should be fixed anyway.

I've found the problem and changed the code, so the next release will fix this.

Nice demo program. You seem to really understand how this works! The only thing I can think of commenting in your program is that you can use "App.Time" directly for current time in seconds instead of using a custom variable.

I will release a 1.01 version with bug-fixes early next week at the latest.
nmarshall
Posts: 14
Joined: Wed Mar 14, 2007 11:59 pm
Location: Los Angeles, California

Post by nmarshall »

Ok, thanks for looking at my coordinate test. One thing I would like to fix is that I use the mouse button to switch between the two AppStates but it switches so fast back and forth you can't really control it. What would you suggest for that? Maybe setting a variable to the current time and then not allowing another switch until a fraction of a second later?
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Normally the KeyPress.RepeatDelay takes care of this, but since you have two different KeyPress instances this will not work because the delay is local to the running KeyPress-component.

You can of course use left mouse button for one state and right mouse button for the other state :)

Otherwise you need to set a delay-variable yourself, or use only one instance of KeyPress (directly in App.OnUpdate) and use a condition component to switch to one of your states.
Post Reply