Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

background-repeat equivalent for decorators #259

Closed
RWD-Biggs opened this issue Dec 10, 2021 · 1 comment
Closed

background-repeat equivalent for decorators #259

RWD-Biggs opened this issue Dec 10, 2021 · 1 comment
Labels
enhancement New feature or request support Usage questions

Comments

@RWD-Biggs
Copy link

I'm attempting to make an image repeat itself horizontally across its element, but there doesn't seem to be a way of doing this currently in RCSS. There are tiled-* decorators, but it looks like they are meant for stretching the center of images while keeping the edges/corners the original size. Will I need to create a custom decorator for this?

@mikke89
Copy link
Owner

mikke89 commented Dec 10, 2021

A custom decorator is probably the cleanest solution right now.

Otherwise, this is a bit hacky but I think it should work depending on your renderer:

  • Define a spritesheet and add a sprite that is some multiple wider than the actual image size. So for example for an image with 100 px width, set the sprite width to 400px for 4x repetition.
  • Use the image decorator and use that sprite, you may also want to adjust the image-fit parameter.
  • Make sure your renderer is set to repeat the texture for UV coordinates greater than one.

We could also add an image-fit: repeat property value to the image decorator, I'd happily take a PR for that.

@mikke89 mikke89 added enhancement New feature or request support Usage questions labels Jan 17, 2022
@mikke89 mikke89 closed this as completed Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request support Usage questions
Projects
None yet
Development

No branches or pull requests

2 participants