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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Next line instead of scrolling
« previous next »
  • Print
Pages: [1]

Author Topic: Next line instead of scrolling  (Read 1135 times)

Offline DustyTill

  • Member
  • *
  • Posts: 37
Next line instead of scrolling
« on: September 17, 2017, 02:47:11 PM »
Hi, is there a way for a text in the wps to go to the next line instead of scrolling when they're too long?
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Next line instead of scrolling
« Reply #1 on: September 17, 2017, 06:26:46 PM »
First off I recommend reading about Custom WPS in your device manual

specifically about %s and %ss
https://www.rockbox.org/wiki/CustomWPS#Other_Tags
%ss(start, length, tag)   Get a substring of another tags value



Do note:
 this link is out of date the one in manual will be more up to date..
 both DO contain inaccuracies.

That being said you could probably (ab)use the theme parser something like this..
%?if(%ss(0, 10, %it), =, %it)<%al%it|%al%ss(0, 10, %it)>
%?if(%ss(10, 10, %it), =, %ss(10, 10, %it))<%ss(10, 10, %it)|%s%ac%?ia<%ia|Unknown Artist>>

that breaks down like this:
%?if(%ss(0, 10, %it), =, %it)<%al%it                       |      %al%ss(0, 10, %it)>
if string < 11                       then display track name (else) then display 10 chars

%?if(%ss(10, 10, %it), =, %ss(10, 10, %it))<%ss(10, 10, %it)           |     %s%ac%?ia<%ia|Unknown Artist>>
if string > 10                                                 then display 10 more  (else) then display artist name

I 'THINK' you could probably carry it out further with..
%?if(%ss(20, 10, %it), =, %ss(20, 10, %it))<%ss(20, 10, %it)|%s%ac%?ia<%ia|Unknown Artist>>

this seems like it could get complicated quickly depending how many variables you wanted to do this with.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Next line instead of scrolling
 

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

Page created in 0.066 seconds with 15 queries.