Jump to content
LaunchBox Community Forums

Script to show game titles in overview


thatkookooguy

Recommended Posts

Hi Everyone! I found it really hard to search for games when looking at a console and none are expanded.

I wrote a little script that writes the name of each game on top of it's cover so I'll be able to find games easier and even use the browser's search functionality on a console.

Here's the script and how to use it:

1. Create a new bookmark in your favorite browser

2. Enter the following name: "Launchbox - inject names"

3. As the URL, enter the following code: 

javascript:(function() { $('.box-item').each(function(){ let qElm = $(this); let boxWidth = this.clientWidth; let imgWidth = qElm.find('img')[0].clientWidth; let boxHeight = this.clientHeight; let imgHeight = qElm.find('img')[0].clientHeight; let hSpace = (boxHeight - imgHeight) / 2; let wSpace = (boxWidth - imgWidth) / 2; let name = $.trim(qElm.next().find('h3').text()); qElm.append(`<div style="position: absolute;bottom: ${hSpace + 5}px;left: ${wSpace}px;right: ${wSpace}px;color: white;display: flex;align-items: center;text-align: center;justify-content: center;background: rgba(0, 0, 0, 0.5)">${name}</div>`); });})()

I usually put this in my bookmark bar for easy access. Look at the gif for a quick demo.

I hope someone else will find this useful ?
 

example.gif

 

Notice that it might take a while if your rom collection for a specific console is huge ?

Edited by thatkookooguy
grammar + nit fixes
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...