.
Results 1 to 13 of 13

Thread: Trainz Objects in HTML Mini Browser

  1. #1
    Join Date
    Dec 2011
    Location
    USA Florida and Illinois
    Posts
    1,229
    Blog Entries
    1
     

    Question Trainz Objects in HTML Mini Browser

    If this post needs to be moved please do..

    I have created a HTML asset, it's working great. I am having problems formatting the html web pages that use the <trainz-object> tag to format correctly in the Trainz Mini Browser. The object I am using is the Session Message Popup. This is the wiki that I am referring to;

    http://online.ts2009.com/mediaWiki/i...hp/MiniBrowser

    No matter how I try to format the objects position, it always floats back up to the top left corner of the browser as seen here;



    Here is the code for when I tried to put the object in a table, I also tried it in the <p></p> tags;

    Code:
    <html>
    <body>
        <table>
            <tr>
                <td><img src="CDETrainz.png"></td>
            </tr>
        </table>
        <p><b>CDETrainz.com</b></p>
        <p>&nbsp;</p>
        <p>Routes and Sessions for Trainz Railroad Simulator<br>Trainz T:ANE (TANE) and Trainz TRS 2019 (TRS19)</p>
        <p>&nbsp;</p>
        <p>Follow our Team on the Trainz User Forums</p>
        <table>
            <tr>
                <td><img src="Trainz Discussion Forum.png"></td>
            </tr>
        </table>
        <p>Trainz Forum Usernames;</p>
        <p>* Christopher824<br>* RockyRR</p>
        <p>&nbsp;</p>
        <p>
            <table>
                <tr>
                    <td><trainz-object style=score-gauge star-thresholds=3 points=0 high-score=3></td>
                </tr>
            </table>
        </p>
    </body>
    </html>
    Any help is appreciated.
    Last edited by Christopher824; November 18th, 2020 at 12:37 PM. Reason: updated code
    If it's not broke, don't fix it.


  2. #2

    Default

    Hi Chris

    I haven't used the mini browser in TS2019 yet but the additional tags look interesting.

    I don't know what you have tried but a couple of suggestions:
    Add the height and width values to <trainz-object width=? height=? style=?> you already have the style. I suggest this as the score guage appears to be to big for the mini browser window.
    Also try replacing <p>&nbsp;</p> code with <br> just to keep it simple - honestly I don't think this will help but I've seen stranger things happen

    Good luck
    Regards
    Ian S.

  3. #3
    Join Date
    Dec 2011
    Location
    USA Florida and Illinois
    Posts
    1,229
    Blog Entries
    1
     

    Default

    Quote Originally Posted by stokia01 View Post
    Hi Chris

    I haven't used the mini browser in TS2019 yet but the additional tags look interesting.

    I don't know what you have tried but a couple of suggestions:
    Add the height and width values to <trainz-object width=? height=? style=?> you already have the style. I suggest this as the score guage appears to be to big for the mini browser window.
    Also try replacing <p>*</p> code with <br> just to keep it simple - honestly I don't think this will help but I've seen stranger things happen

    Good luck
    I am beginning to believe that the <trainz-object style=score-gauge ..> is defective

    I tried all suggestions, and no luck. I tried two other <trainz-object>'s, the progress and the static-line objects. They work as expected with no issues placing them wherever I want them. Although the <p>..</p> and <br> tags both work as you would expect, I think using tables is easier to setup the page. You can even combine them all and it all still works.

    Not documented is that the progress bar progress must be a decimal, ie. for 75% you enter 0.75 and must have a height and width to display. The static-line must have height, width, and color in RGB HEX ie. #RRGGBB (yellow is #FFFF00).

    Sample code
    Code:
    <html>
    <body>
        <table>
            <tr>
                <td><img src="CDETrainz.png"></td>
            </tr>
    	    <tr>
    	        <td><b>CDETrainz.com</b></td>
    	    </tr>
            <tr>
                <td><trainz-object style=static-line color=#FFFF00 height=2 width=400></trainz-object></td>
            </tr>
            <tr>
                <td><trainz-object style=progress progress=0.7 width=200 height=20></trainz-object></td>
            </tr>
        </table>
    </body>
    </html>
    Result;




    .
    If it's not broke, don't fix it.


  4. #4

    Default

    Hi Chris

    I've had a look at this in TRS19. The Width height tags are important.

    This worked for me

    Code:
    <html>
    <body>
    <trainz-object width=500 height=250 style=score-gauge star-thresholds=3 points=0 high-score=5> </trainz-object>
    <br>
    <p>Some text here</p>
    <p>An image</p>
    <img src="train.bmp">
    </body>
    </html>
    Good luck
    Regards
    Ian S.

  5. #5

    Default

    PS

    The width and height are about the minimum that would work. You could probably reduce the height to 200 but I think the width is the most critical in this case.
    Regards
    Ian S.

  6. #6
    Join Date
    Dec 2011
    Location
    USA Florida and Illinois
    Posts
    1,229
    Blog Entries
    1
     

    Default

    Quote Originally Posted by stokia01 View Post
    Hi Chris

    I've had a look at this in TRS19. The Width height tags are important.

    This worked for me

    Code:
    <html>
    <body>
    <trainz-object width=500 height=250 style=score-gauge star-thresholds=3 points=0 high-score=5> </trainz-object>
    <br>
    <p>Some text here</p>
    <p>An image</p>
    <img src="train.bmp">
    </body>
    </html>
    Good luck
    Still floats to the top, I reordered your code a little to have text above the object, its still stuck on the top.

    Code:
    <html>
    <body>
        <p>Some text here, more text, more text</p>
        <p>An image is an image is an image, where did it go?</p>
        <p><img src="CDETrainz.jpg"></p>
        <trainz-object width=500 height=250 style=score-gauge star-thresholds=3 points=0 high-score=5> </trainz-object>
        <br>
    </body>
    </html>



    Quote Originally Posted by stokia01 View Post
    PS

    The width and height are about the minimum that would work. You could probably reduce the height to 200 but I think the width is the most critical in this case.
    I have tried it with and without the height and width tags, they only change the size of the object and do not effect its operation, they do not help with the bug that it always floats to the top of the browser window.
    If it's not broke, don't fix it.


  7. #7

    Default

    Hi Chris
    Sorry I couldn't be of more help.
    But for what it's worth I have tested the placement of the gauge object and confirm what you are experiencing - the gauge always shows at the top of the mini browser window irrespective of the placement of the code to display the gauge.
    Would be worth filling in a bug report with a link to this thread.
    Regards
    Ian S.

  8. #8
    Join Date
    Dec 2011
    Location
    USA Florida and Illinois
    Posts
    1,229
    Blog Entries
    1
     

    Default

    Quote Originally Posted by stokia01 View Post
    Hi Chris
    Sorry I couldn't be of more help.
    But for what it's worth I have tested the placement of the gauge object and confirm what you are experiencing - the gauge always shows at the top of the mini browser window irrespective of the placement of the code to display the gauge.
    Would be worth filling in a bug report with a link to this thread.
    Thanks for the help. I just submitted a help desk ticket Ticket ID #XWV-762-24410
    If it's not broke, don't fix it.


  9. #9
    Join Date
    Jan 2016
    Location
    United States of America, California
    Posts
    213
     

    Default

    I've never used the Trainz HTML code and mini browser. So I don't know what HTML codes it supports.

    Since everything is inside a <table></table> I'm not certain how well the HTML "clear" will work. But you could try one of the following:

    <img style="clear:both;" src="CDETrainz.jpg">

    <img style="clear:right;" src="CDETrainz.jpg">

    <img style="clear:left;" src="CDETrainz.jpg">


    hope that helps
    Dave

  10. #10
    Join Date
    Dec 2011
    Location
    USA Florida and Illinois
    Posts
    1,229
    Blog Entries
    1
     

    Default

    Quote Originally Posted by OddRails View Post
    I've never used the Trainz HTML code and mini browser. So I don't know what HTML codes it supports.

    Since everything is inside a <table></table> I'm not certain how well the HTML "clear" will work. But you could try one of the following:

    <img style="clear:both;" src="CDETrainz.jpg">

    <img style="clear:right;" src="CDETrainz.jpg">

    <img style="clear:left;" src="CDETrainz.jpg">


    hope that helps
    The Trainz HTML has very few / basic tags only, plus some Trainz objects you can embed. Styles do not work.

    https://online.ts2009.com/mediaWiki/...hp/MiniBrowser
    If it's not broke, don't fix it.


  11. #11
    Join Date
    Jan 2016
    Location
    United States of America, California
    Posts
    213
     

    Default

    Quote Originally Posted by Christopher824 View Post
    The Trainz HTML has very few / basic tags only, plus some Trainz objects you can embed. Styles do not work.

    https://online.ts2009.com/mediaWiki/...hp/MiniBrowser
    Thanks Christopher824,

    I think that using the style command in that fashion is possibly an HTML5 feature ... which made support unlikely. Thanks for the link.
    Last edited by OddRails; October 9th, 2021 at 04:58 PM. Reason: fix typo
    Dave

  12. #12
    Join Date
    Dec 2011
    Location
    USA Florida and Illinois
    Posts
    1,229
    Blog Entries
    1
     

    Default

    Quote Originally Posted by OddRails View Post
    Thanks Christopher824,

    I think that using the style command in that fashion is possibly an HTML5 feature ... which made support unlikely. Thanks for the link.
    I believe styles were introduced with HTML 3.0, there are some convoluted stories, Trainz HTML is all by itself, consider it HTML 1.0 or less. The 'styles' are the Trainz objects you can put on the page. The one that I can't figure out is the 'style=score-gauge'. That is what the post is about. I checked the Trainz Wiki page, and it has changed since I submitted a bug report, so I may have to retry my pages with different parameters, stay tuned.

    Thanks for you interest
    If it's not broke, don't fix it.


  13. #13
    Join Date
    Nov 2006
    Location
    United States of America, Michigan, Manchester
    Posts
    6,082
    Blog Entries
    27
     

    Default

    This thread seems to unnaturally attract spam, so I'm going to lock it.

    If you have a legitimate response to the topic, report this post and for the reason ask for it to be unlocked.
    ~Peter


    I do not provide support via PM.
    Now at a new location!
    www.americantrainz.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •