Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Skin viewport layering (draw text over images etc)
« previous next »
  • Print
Pages: [1]

Author Topic: Skin viewport layering (draw text over images etc)  (Read 2881 times)

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Skin viewport layering (draw text over images etc)
« on: November 30, 2011, 05:47:44 AM »
Hi all,
This is a screenshot of what I've been working on recently. It's static so a bit hard to guess what is so impressive....


With svn, if you try drawing text over an image it will be very unpredictable as to what happens, and if the text scrolls you will get a line of the background colour instead of the image. So what I have added is a way to be able to draw directly to the background 'layer' which means you draw images onto one layer and text/dynamic stuff onto the normal layer.

It's a bit complicated to make work which is why I'm making this post, so hopefully the skin code is understandable.

Unless specified all viewports draw into the normal layer like now. If *any* viewports have the tag %VL in them will disable the normal backdrop handling (%Xd()) and cause those viewports to draw onto a new layer (which will have the flat bg_colour as its default colour)). Viewports without %VL then use that backdrop layer for their backdrop image.

Does that make any sense?
Attached is a modified cabbiev2.wps for the 240x320 pixel targets which demonstrates how to use this.

As you can see, the first viewport (Line 3) covers the whole screen and has the %VL tag so it is the background layer. In this example I draw the normal background image but there is no reason to draw the whole thing, you could draw multiple smaller images if you wanted. The only important thing though is you *must* use %x() because %xl() will cause the image to redraw too often and break the layering.

Next you can see the AA viewport also draws to the backdrop layer, then there is one more viewport which covers the whole screen (required or you might not redraw the whole screen) and the rest of the wps is unmodified.

comments?

This isnt in svn yet and needs some fiddling with drivers to work, so if you want to help test tell me which target to build for you.


* cabbiev2.wps (1.83 kB - downloaded 118 times.)
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline lebellium

  • Member
  • *
  • Posts: 71
  • DAPs collector
    • My 100+ players collection
Re: Skin viewport layering (draw text over images etc)
« Reply #1 on: November 30, 2011, 01:53:44 PM »
It seems that is what I need for my R0 theme  ;D

I'm just not sure to have really understood for the %x()  vs %xl() tag but well I'll see that when I have the opportunity to try your new code, I hope very soon  :P
« Last Edit: November 30, 2011, 02:03:00 PM by lebellium »
Logged
I swim in mp3 players!

Offline Poodlemastah

  • Member
  • *
  • Posts: 4
Re: Skin viewport layering (draw text over images etc)
« Reply #2 on: December 02, 2011, 11:45:05 AM »
Perhaps this would be a good time to include some kind of shadow/outline to ensure readability?
Take your SS for example, there the text over the AA is basically unreadable?
Logged

Offline kugel.

  • Developer
  • Member
  • *
  • Posts: 271
Re: Skin viewport layering (draw text over images etc)
« Reply #3 on: December 02, 2011, 12:05:32 PM »
Quote from: Poodlemastah on December 02, 2011, 11:45:05 AM
Perhaps this would be a good time to include some kind of shadow/outline to ensure readability?
Take your SS for example, there the text over the AA is basically unreadable?

I don't think that's needed. Normally you aren't going to draw above arbitrary images (read: album art), but known ones. Then you can select the font (e.g. anti-aliased) and color appropriately.
Logged
 

Offline cereal_killer

  • Member
  • *
  • Posts: 409
Re: Skin viewport layering (draw text over images etc)
« Reply #4 on: December 04, 2011, 08:54:38 AM »
So then it might be possible to use the albumart as a backdrop in the wps? That would be cool, especially when I am thinking of screens like the ones of the clip zip, where there is not too much space. But the readability has to be considered, because usually CD covers are images with different colours.
Logged

Offline lebellium

  • Member
  • *
  • Posts: 71
  • DAPs collector
    • My 100+ players collection
Re: Skin viewport layering (draw text over images etc)
« Reply #5 on: February 18, 2012, 01:11:12 PM »
Any progress on that project JdGordon?  :)

I really need a solution for my R0 theme  ;D
Logged
I swim in mp3 players!

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Skin viewport layering (draw text over images etc)
« Reply #6 on: February 18, 2012, 07:00:44 PM »
no, real life is taking all my time!
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Skin viewport layering (draw text over images etc)
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.092 seconds with 15 queries.