Help with Panel Positioning

View previous topic View next topic Go down

Help with Panel Positioning

Post by waterburn on Fri Jul 08, 2016 12:22 am

I have a 1920x1080 panel using this data:

Resolution = 1920
Left = 0
Right = 1920
Top = 1080
Bottom = 0

The panel is not filing the entire screen. Any ideas why? Also, what would be the best resolution for the panel image?

Thanks.

waterburn

Posts : 54
Join date : 2012-06-29

Back to top Go down

Re: Help with Panel Positioning

Post by graymac on Fri Jul 08, 2016 1:14 pm

The convention is for a 1024 x 1024 panel graphic. Example here, from CTS 2800 dmu.
The "space" below the desk has been infilled to blank off the bottom, which would only be visible anyway if the user scrolled the arrows to show it.



The code in this case is:
[This]
Resolution = 1024
Left = 0
Top = 0
Right = 1270
Bottom = 855
DaytimeImage = ..\d3d\panel2.png
NighttimeImage = ..\d3d\panel2_n.png
TransparentColor = #0000FF
Center = 500,420
Origin = 400,230

Note here that the "Right" dimension exceeds the image size, but another image ("keys") fills that gap. (It's the pic with the basic controls written on it, to the far right of the cabview).
You should obtain the full documentation for OpenBVE developers for detailed explanation of cab construction. I have it on the CTS site http://celtictrainsim.com/ctsdownloads/resourcestuff/documentation.7z

graymac

Posts : 1704
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: Help with Panel Positioning

Post by waterburn on Fri Jul 08, 2016 6:00 pm

So the grid goes left to right and bottom to top? So 0 pixels along y starts at the top?

Also wondering any particular reason 1024x1024?

waterburn

Posts : 54
Join date : 2012-06-29

Back to top Go down

Re: Help with Panel Positioning

Post by Stevegr on Fri Jul 08, 2016 10:01 pm

I would suggest having a look at some of my cab work and how it's configured.

That's what I did with the TSC releases nearly 10 years ago to figure it out.

But you have to use the power of 2 in bve.

So that's 2,4,8,16,32,64,128,256,512,1024,2048 for a texture size.

So you could have a panel 2048x1024 for example.

But have a look at my stuff, many of my later work is not 1024x1024.

That's very bve4 Laughing

I was just being a bit Open there.......

Stevegr

Posts : 119
Join date : 2013-01-01
Location : CARDIFF

https://sites.google.com/a/bve4trains.com/bve4trains/

Back to top Go down

Re: Help with Panel Positioning

Post by leezer3 on Mon Jul 11, 2016 2:08 pm

Sounds suspiciously like this:
https://github.com/leezer3/OpenBVE/issues/77

If you're using one of my builds, there's a reasonable chance something has got broken somewhere...
Even if it's nothing I've broken, I'd rather like to sort this out; It sounds very much like a bug.

With that in mind, any chance of a copy of the train so I can do some digging please?
Stripping everything out other than the panel image and configuration file should do.

Cheers

leezer3

Posts : 747
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Help with Panel Positioning

Post by Stevegr on Mon Jul 11, 2016 3:16 pm

The power of 2?

This is because if a texture of any sort in bve and Open Bve that's not to the power of 2 will be stretched or compressed by the program in an effort to make it fit better!

So you end up with translucent outer edges to the texture (that will show the route) and you will also get roughly the colour of any transparent (like windscreen sides) edges showing.

Another example is making your route backgrounds not to the power of 2, you end up with what appear to be black lines between each texture panel...... Laughing  

In Waterburns case these figures should result in the panel sitting a bit better.

Resolution = 1080
Left = 0
Right = 1920
Top = 0
Bottom = 1080

Also this will put the viewpoint of the panel texture to the middle of it.

Center = 960, 540
Origin = 960, 540

But the panel and any other textures needs to be to the power of 2, any animation of the cab if you don't will not show correctly either.

Stevegr

Posts : 119
Join date : 2013-01-01
Location : CARDIFF

https://sites.google.com/a/bve4trains.com/bve4trains/

Back to top Go down

Re: Help with Panel Positioning

Post by leezer3 on Mon Jul 11, 2016 4:56 pm

I know about the power of 2, but they should automatically be being upsized to the appropriate size when they're loaded.
( https://github.com/leezer3/OpenBVE/blob/master/openBVE/OpenBve/Graphics/Textures.cs#L205 )
Keeping to the power of two means that no interpolation will be done when the texture is resized. (There was a thread about this on Michelle's forum where she provided some more technical discussion about why borders and transparencies didn't work properly on stuff which isn't to the power of 2)

Whilst this may well cause the border of transparency issues that you're mentioning, but it *shouldn't* cause massive gaps to the sides of the panel, which would appear to be what this and the user on my Github are reporting.

I really need something that reliably reproduces this from someone who has the problem though- It's no use me making assumptions without the problem in front of me. (Even if I can't reproduce this, it tells me something....)

leezer3

Posts : 747
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Help with Panel Positioning

Post by Stevegr on Tue Jul 12, 2016 1:02 pm

The massive gaps have nothing whatever to do with any version of Open Bve having a glitch.

That's just incorrect coding of the panel causing them.

The resolution should be 1080 not 1920 for example, that's the cause of the top and bottom gaps of 420 pixies each because the panel is only 1080 tall.

Stevegr

Posts : 119
Join date : 2013-01-01
Location : CARDIFF

https://sites.google.com/a/bve4trains.com/bve4trains/

Back to top Go down

Re: Help with Panel Positioning

Post by thehoviskid on Tue Jul 12, 2016 4:43 pm

On the other hand....  Would it not be helpful if, where a 2D panel (which inclused a sidebar with controls,as that's really part of the panel) is used, the rest of the screen could automatically be blanked?  Could it be made to behave that way?  Or at least not let you naviagate beyone the panel, as (I think) BVE4 did?

thehoviskid

Posts : 128
Join date : 2011-07-09
Age : 39
Location : Heysham

Back to top Go down

Re: Help with Panel Positioning

Post by Stevegr on Tue Jul 12, 2016 5:37 pm

Yes, that's what the left, right, top and bottom lines in the code are for.

Then of course your have the centre and origin lines for position of cab and what you view of it without moving around it.

The Class 67 from my site is an example of a cab made up of top, bottom, left side and right side panels.

That are pushing what Open Bve can do a bit as it appears to tilt over when you go far left or right!

In the case of the right side that's why you don't see a keys controls menu after it! Laughing

If I made that one today it would possibly work better as one 2048x2048 single panel.

Traditional single panel cabs for bve4 onwards have been 1024x1024 for the panel size, although the cab image on the panel might be only 1024x800 ish.

So the bottom code line would be set to 800 so you don't see below it.

Stevegr

Posts : 119
Join date : 2013-01-01
Location : CARDIFF

https://sites.google.com/a/bve4trains.com/bve4trains/

Back to top Go down

Re: Help with Panel Positioning

Post by Sponsored content Today at 2:29 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum