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

More ui fixes #1520

Merged
merged 6 commits into from Dec 6, 2018

Conversation

Projects
None yet
4 participants
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Dec 2, 2018

Fixes more from #1443

@fdelapena fdelapena added this to the 0.6.0 (likely) milestone Dec 2, 2018

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 2, 2018

Quick Note: A misalignment of ~2 pixels on y could be also because of the built-in font used because our naive pixel font renderer doesn't use a baseline and not a problem with the scene.

There are two fonts. you can switch between them via the "system" graphic setting in the editor.

Best way to test is with a glyph which takes the whole 12 pixels of height.
Here is the pixel font: https://github.com/EasyRPG/Player/tree/master/resources/shinonome

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 2, 2018

We seem to hard code a y offset of 2 in many window classes

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 2, 2018

k, then I need to check this. Don't know which ones but for some windows I measured the font position via screenshots and paint ^^

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 2, 2018

Take a look at Window_Help. It's almost exactly like this.

Also my last PR for status had y = 2

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 2, 2018

I added animation for the file menu slots but there is a problem. RPG_RT keeps a small blue rectangle above and below the 3 displayed file menu boxes.

Whats the best way to preserve this behavior in Player? Do we have a mechanism to define a clipping rectangle so that as the file box animates up/down it wont cover the border?

If not, I guess the other way would be to actually render 2 blue rectangles ontop of the windows?

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:more_window_fix branch 2 times, most recently from c3f711a to 4a8476f Dec 2, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 2, 2018

How can I draw single color Sprite?

I've tried this but I don't see anything. What am I missing?

auto* border = new Sprite();
border->SetSrcRect(Rect(0, 32, SCREEN_TARGET_WIDTH, 8));                      
border->SetVisible(true);
border->SetZ(Priority_Window + 10);
border->SetBitmap(Bitmap::Create(0, 32, SCREEN_TARGET_WIDTH, 8));
border->GetBitmap()->Fill(Color(255,255,255,255));
border->Update();
@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 2, 2018

You can use "SpriteRef". SetSrcRect is not needed, same for Update, SetVisible could be also useless, not 100% sure. You invoke the wrong Bitmap::Create constructor, guess this invokes width, height, transparent, bpp. Guess you want to invoke width, height, Color.

With the whc-constructor you can remove the fill-call.

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 2, 2018

and the system background is Cache::System()->GetBackgroundColor()

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 2, 2018

I added the border sprites and now the animation matches RPG_RT. I don't have any additional changes I want to make here unless we need to fix things for review.

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:more_window_fix branch from ee10b15 to be4a403 Dec 3, 2018

Show resolved Hide resolved src/scene_file.cpp Outdated

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:more_window_fix branch from be4a403 to ca323ba Dec 4, 2018

@Ghabry
Copy link
Member

Ghabry left a comment

There is a strange flicker when scrolling from 1 to 15 and from 15 to 1, maybe disable the animation for that case and jump directly?

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 5, 2018

It's actually animating the windows super fast. The delta in space is x15 but the delta in time is the same.

Using PageUp / PageDown also scrolls 3 times faster

I like this better than an instant transition. All motions up, down, pageup, pagedown all have the same speed and delay.

All fileboxes always visible
Improves pageup, pagedown, and 1 <-> 15
@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 6, 2018

Well, this looks okay, but I just found something else, sorry:

The newest savegame is in Slot 13 and when I open the load scene it scrolls from 1 to 13 quickly but in 2k3 the scene opens directly on that slot without anim

@Ghabry

Ghabry approved these changes Dec 6, 2018

@Ghabry Ghabry merged commit 2bf8b2b into EasyRPG:master Dec 6, 2018

6 checks passed

Android (armeabi-v7a) Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@fmatthew5876 fmatthew5876 deleted the fmatthew5876:more_window_fix branch Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.