The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » Blu-ray Disc Java

Thread: No animation with text?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 7 - Last Post: Jan 8, 2009 6:09 PM by: wxiong Threads: [ Previous | Next ]
wxiong

Posts: 5
No animation with text?
Posted: Jan 7, 2009 2:04 PM
 
  Click to reply to this thread Reply

Hi,

GRIN-based animation works great but translator does not seem working if "feature fixed_image" is replaced with "feature text"?

Can you please clarify?

Bill Foote
Re: [BD-J-DEV] No animation with text?
Posted: Jan 7, 2009 2:54 PM   in response to: wxiong
  Click to reply to this thread Reply

bd-j-dev@mobileandembedded.org wrote:
> Hi,
>
> GRIN-based animation works great but translator does not seem working if "feature fixed_image" is replaced with "feature text"?
>
> Can you please clarify?

No, that should work fine. The Translator mode works by
calling java.awt.Graphics.translate(int, int) and then
painting its child; it doesn't make any difference what
the child is.

Can you make a small, stand-alone GRIN text file that
reproduces what you're seeing? Perhaps one with two
segments, one where a fixed_image is translated, and
a second one where a text feature is translated.

Bill

> [Message sent by forum member 'wxiong' (wxiong)]
>
> http://forums.java.net/jive/thread.jspa?messageID=324638
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>


---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net


wxiong

Posts: 5
Re: [BD-J-DEV] No animation with text?
Posted: Jan 7, 2009 3:36 PM   in response to: Bill Foote
 
  Click to reply to this thread Reply

Thanks, Bill.

In the bookmenu sample, the menu animation disappeared if I replaced

"feature fixed_image F:MainMenu.Play.Normal 450 880
"Graphics/Menu/Play_N.png" ;"

with

"feature text F:MainMenu.Play.Normal 450 880
{ "Play" }
Lisa plain 60 { { 255 0 0 255 } } ;"

(F:MainMenu.Play.Selected and F:MainMenu.Play.Activated were changed accordingly too.)

I also tried to change all four menu-items (play, setup, scene and bonus) from fixed_image to text, there was no animation either.

BTW, I temporarily removed frame skipping in runAnimationLoop in the ClockBasedEngine so that animation can always be seen regardless running time.

Bill Foote
Re: [BD-J-DEV] No animation with text?
Posted: Jan 7, 2009 4:19 PM   in response to: wxiong
  Click to reply to this thread Reply



Can you reproduce the behavior with a small, stand-alone
example that I could run in grinview directly?

One possibility is that you might be playing this on a PC
player -- I've seen inconsistencies in font rendering
on at least one PC player. Are you sure the problem is
related to the translation, and not just the font rendering?

Cheers,

Bill

bd-j-dev@mobileandembedded.org wrote:
> Thanks, Bill.
>
> In the bookmenu sample, the menu animation disappeared if I replaced
>
> "feature fixed_image F:MainMenu.Play.Normal 450 880
> "Graphics/Menu/Play_N.png" ;"
>
> with
>
> "feature text F:MainMenu.Play.Normal 450 880
> { "Play" }
> Lisa plain 60 { { 255 0 0 255 } } ;"
>
> (F:MainMenu.Play.Selected and F:MainMenu.Play.Activated were changed accordingly too.)
>
> I also tried to change all four menu-items (play, setup, scene and bonus) from fixed_image to text, there was no animation either.
>
> BTW, I temporarily removed frame skipping in runAnimationLoop in the ClockBasedEngine so that animation can always be seen regardless running time.
> [Message sent by forum member 'wxiong' (wxiong)]
>
> http://forums.java.net/jive/thread.jspa?messageID=324658
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>


---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net


wxiong

Posts: 5
Re: [BD-J-DEV] No animation with text?
Posted: Jan 7, 2009 7:02 PM   in response to: Bill Foote
 
  Click to reply to this thread Reply

Following is small example that can reproduce the problem.

I am using CinePlayer on PC but I saw similar behavior on PS3. I'll double check this simplified example on PS3.

Thanks,

-Wei

###################################################################

show

setting segment_stack_depth 1 ;

setting draw_targets {
T:MovingMenu
} ;

exports
segments {
S:Initialize
} features {
} handlers {
}
;

feature group F:Nothing {
} ;

###############################################################
#................ Translator works with following lines ................
feature fixed_image F:MainMenu.Play.Normal 1000 880
"Graphics/Menu/Play_N.png" ;

feature fixed_image F:MainMenu.Play.Selected 1000 880
"Graphics/Menu/Play_S.png" ;

feature fixed_image F:MainMenu.Play.Activated 1000 880
"Graphics/Menu/Play_A.png" ;

#................ Translator does not work with following lines ................
#feature text F:MainMenu.Play.Normal 1000 880
# { "Play" }
# Lisa plain 60 { { 255 0 128 255 } } ;

#feature text F:MainMenu.Play.Selected 1000 880
# { "Play" }
# Lisa plain 60 { { 128 255 0 255 } } ;

#feature text F:MainMenu.Play.Activated 1000 880
# { "Play" }
# Lisa plain 60 { { 0 128 255 255 } } ;
###############################################################

feature group F:MainMenu.PlaySelected {
F:MainMenu.Play.Selected
} ;

feature assembly F:MainMenu {
play.selected F:MainMenu.PlaySelected
} ;

feature translator_model F:MainMenu.In.Coords {
0 -750 880 linear
60 1000 880 linear
}
end_commands {
segment_done ;
}
;

feature translator F:MainMenu.In.Mover
F:MainMenu.In.Coords
{ F:MainMenu.Targeted }
;

feature set_target F:MainMenu.Targeted F:MainMenu.Guaranteed
T:MovingMenu ;

feature guarantee_fill F:MainMenu.Guaranteed F:MainMenu
( 1500 100 1500 101 )
{
( 1500 100 1500 101 )
}
;

feature group F:MainMenu.In.Unclipped {
F:MainMenu.In.Coords
F:MainMenu.In.Mover
} ;

feature clipped F:MainMenu.In
F:MainMenu.In.Unclipped
( 400 880 1979 980 )
;

feature group F:Everything {
F:MainMenu.Targeted
F:MainMenu.In
} ;

segment S:Initialize
active {
F:Nothing
}
setup {
F:Everything
}
setup_done {
activate_segment S:MenuRollin ;
}
;

segment S:MenuRollin
active {
F:MainMenu.In
}
next {
activate_segment S:MenuShow ;
}
;

segment S:MenuShow
active {
F:MainMenu
}
;

end_show

wxiong

Posts: 5
Re: [BD-J-DEV] No animation with text?
Posted: Jan 8, 2009 3:15 PM   in response to: wxiong
 
  Click to reply to this thread Reply

I just confirmed that the above example had same behavior on PS3. That is, animation with image worked fine but animation with text did not work. .

Bill Foote
Re: [BD-J-DEV] No animation with text?
Posted: Jan 8, 2009 5:13 PM   in response to: wxiong
  Click to reply to this thread Reply

bd-j-dev@mobileandembedded.org wrote:
> Following is small example that can reproduce the problem.
>
> I am using CinePlayer on PC but I saw similar behavior on PS3. I'll double check this simplified example on PS3.
>
> Thanks,
>
> -Wei


OK... A really minimal example would have made the problem
come out more clearly, but here's the deal: The example you
gave is using the old, deprecated "linear" style of specifying
coordinates to the translator_model. I guess that's because
you took the old example of the cookbook menu, which was written
before the new, better "linear-relative" style was invented.
"linear" is problematic with some feature subtypes; it was kept
for backwards compatibility (e.g. with old examples), but the
GRIN compiler issues a warning recommending a switch to linear-relative,
because it's dangerous.

I have a pending putback that significantly strengthens the deprecation
warning, and also changes the compiler to recognize that "linear"
and text features don't mix. With the putback, your example will
fail, with this message:

WARNING: Deprecated non-relative linear interpolation;
consider using linear-relative instead.
Note that "linear" isn't guaranteed to work with all feature types.
For example, it's known that it doesn't work with the text feature.
==> Dangerous usage occurs on line 49
java.io.IOException: Can't determine upper-left hand coordinates of tranlator's child at line 56
at com.hdcookbook.grin.io.builders.TranslatorHelper.finishBuilding(TranslatorHelper.java:239)
at com.hdcookbook.grin.io.ShowBuilder.finishBuilding(ShowBuilder.java:318)
at com.hdcookbook.grin.test.bigjdk.GuiShowBuilder.finishBuilding(GuiShowBuilder.java:108)
at com.hdcookbook.grin.io.text.ShowParser.finishBuilding(ShowParser.java:2140)
at com.hdcookbook.grin.io.text.ShowParser.parse(ShowParser.java:333)
at com.hdcookbook.grin.test.bigjdk.GenericMain.createShow(GenericMain.java:315)
at com.hdcookbook.grin.test.bigjdk.GenericMain.init(GenericMain.java:225)
at com.hdcookbook.grin.test.bigjdk.GrinView.main(GrinView.java:555)

Can't determine upper-left hand coordinates of tranlator's child at line 56

Error trying to parse bad.txt
URL: file:/Users/billf/tmp/tmp/./bad.txt

Cheers,

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net


wxiong

Posts: 5
Re: [BD-J-DEV] No animation with text?
Posted: Jan 8, 2009 6:09 PM   in response to: Bill Foote
 
  Click to reply to this thread Reply

Great! linear-relative works like a charm for both image and text.




 XML java.net RSS