Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Make measure counter center-aligned #20

Open
andrewipark opened this issue Feb 23, 2019 · 3 comments
Open

Make measure counter center-aligned #20

andrewipark opened this issue Feb 23, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request low priority upstream-try possibly suitable for upstream

Comments

@andrewipark
Copy link
Member

andrewipark commented Feb 23, 2019

During stream, align the measure counter to the slash, so that the numbers do not move horizontally as the player goes through the stream.

During break, just align the measure counter to the center.

The naive solution would require using 3 bitmap text actors instead of one. It is theoretically possible to use one, but that would require an inelegant fix, and is also prone to font issues.

@andrewipark andrewipark added enhancement New feature or request low priority upstream-try possibly suitable for upstream labels Feb 23, 2019
@andrewipark andrewipark self-assigned this Feb 23, 2019
@andrewipark andrewipark changed the title Allign Measure counter to center slash Make measure counter center-aligned Mar 6, 2020
@quietly-turning
Copy link

quietly-turning commented Mar 24, 2020

Perhaps something similar to https://github.com/quietly-turning/Simply-Love-SM5/blob/beta/BGAnimations/ScreenGameplay%20underlay/PerPlayer/SubtractiveScoring.lua#L58-L61 might work.

That is:

  • horizalign(right) the MeasureCounter BitmapText
  • temporarily set tovisible(false)
  • temporarily settext() to the last string the bmt will be.
    • e.g. settext to "110/110" if the next stream is 110 measures
  • local w = self:GetWidth() * self:GetZoom() of the bmt while set to this text
  • set x() of bmt to GetNotefieldX()*0.5 + w*0.5
  • settext() back to an empty string
  • set the bmt back to visible(true)

Repeat this^ for each new stream. Rest counts can simply be center-aligned.

In my head, this should work in base10 systems (which the MeasureCounter uses) given the way most fonts display Arabic numerals (which the MeasureCounter uses).

I think.

This does assume that the MeasureCounter will always have its greatest pixel width at the final measure of stream, so it's inelegant at best, and might not work provided certain, unusual glyphs.

@andrewipark
Copy link
Member Author

Thanks for telling me about self:GetWidth() and this brainstorm. I believe I can work off of that and create a slightly more elegant solution with only one actor.

The question of "when?" is its own story.

@quietly-turning
Copy link

quietly-turning commented Mar 24, 2020

The question of "when?" is its own story.

As a great themer of a bygone era once wrote via inline comment:

-- We await your return, warrior!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request low priority upstream-try possibly suitable for upstream
Projects
None yet
Development

No branches or pull requests

2 participants