Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3698214
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:57:15+00:00 2026-05-19T04:57:15+00:00

I was trying to use a tiled image in an image resource, and i

  • 0

I was trying to use a tiled image in an image resource, and i was refering to the GWT tutorial for it…

one section says you need to use sprites:
http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#ImageResource

repeatStyle is an enumerated value
that is used in combination with
the@sprite directive to indicate that
the image is intended to be tiled

so, now i need to add a sprite directive .. Where ?
researching about sprites, i came here:
http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#Image_Sprites

The example dictates the creation of two files :

  1. MyCssResource
  2. MyResources

where would I write this :

@sprite .mySpriteClass {gwt-image:
“imageAccessor”; other: property;}

?

some more quotes for reference:

@sprite is sensitive to the FooBundle
in which the CSSResource is declared;
a sibling ImageResource method named
in the @sprite declaration will be
used to compose the background sprite.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:57:16+00:00Added an answer on May 19, 2026 at 4:57 am

    From what you’ve written I’m going to presume that MyResources is an interface that extends ClientBundle and MyCssResources is an interface that extends CssResource:

    interface MyResources extends ClientBundle {
      @Source("myImage.png")
      @ImageOptions(repeatStyle = RepeatStyle.BOTH)
      ImageResource myImage();
    
      @Source("myCss.css")
      MyCssResource myCss();
    }
    
    interface MyCssResource extends CssResource {
      String myBackground();
    }
    

    So now there are two ways to use the ImageResource obtained from MyResources. The first is to attach it to a CSS rule using the @sprite directive. myCss.css:

    @sprite .myBackground {
      gwt-image: "myImage";
      /* Additional CSS rules may be added. */
    }
    

    Then, anything with the myBackground class will have myImage as its background. So, using UiBinder, for example:

    <ui:UiBinder> <!-- Preamble omitted for this example. -->
      <ui:with field="myResources" type="com.mycompany.MyResources"/>
    
      <g:FlowPanel styleName="{myResources.myCss.myBackground}"/>
    </ui:UiBinder>
    

    One can also instantiate Image objects directly using the defined ImageResource. UiBinder:

    <ui:UiBinder> <!-- Preamble omitted for this example. -->
      <ui:with field="myResources" type="com.mycompany.MyResources"/>
    
      <g:Image resource="{myResources.myImage}"/>
    </ui:UiBinder>
    

    Without UiBinder:

    MyResources myResources = GWT.create(MyResources.class);
    Image myImage = new Image(myResources.myImage());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to create a mapping for tile/pixel positions in one tiled image dataset
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
I'm trying to load an image file and use it as a texture for
I'm trying to use TIpsy http://plugins.jquery.com/project/tipsy to show usernames when hovering over linked images.
I am trying to use the timed_wait from boost. Now I am actually not
I am trying to compile a tile map editor so I can use it
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.