chrisbrobs's Forum Posts

  • Kyatric@

    I think to put every <style> tags into the <header> tag before the <body> is the way to go as far as css formating goes.

    I don't know if you already seen it but I wrote a tutorial about customizing the index.html page a while ago and added some more concrete example at the end after popular request.

    I hope this can guide you along the way.

    I only started this thread after reading your excellent index,html tutorial !

    ----------------------------------------------------------------------

    ranma@

    the basics are:

    <style type="text/css">

    element {attribute: value; attribute2: value;}

    otherelement {attribute: value;}

    moreelements, somethingelse {attribute: value}

    </style>

    based on that:

    <style type="text/css">

    html,body {

       margin:0;padding:0;border:0

    }

    canvas {

       border: 1px solid red;

    }

    body {

       background-image: url('iPhone.gif');

       background-repeat: no-repeat;

       background-attachment: fixed;

       background-position:center center;

    }

    </style>

    ---------------------------------------------------

    I think my brain is finally starting to digest this stuff.

    Thanks for the tips.

  • Like this: http://activeden.net/item/youtube-music-player/162816?WT.ac=free_file&WT.seg_1=free_file&WT.z_author=CodingJack Obviously this is AS3 but this is what i mean <img src="smileys/smiley1.gif" border="0" align="middle">

    I tried the HTML-div plugin first, but I just can't get my head around the actual settings?

  • also add

    > html,body {margin:0;padding:0;border:0}
    

    default margins / padding are set to be > 0 by default by the browser that's why it's off i think.

    Where would I implement this ?

    I am really new to html5 stuff.

  • Thanks for all your replies.

    7Soul gets the award for expanding my pathetic Knowledge base.

    <img src="smileys/smiley1.gif" border="0" align="middle" />

  • and then there's this:

    http://www.stefankendall.com/2011/12/29/using-appmobi-stop-immediately/

    also I remember Ashley's struggles with them

    and second also, major company like Adobe uses phonegap

    so in conclusion, I'd prefer phonegap export to be the final and working over appmobi as I like to listen to people smarter than me :)

    ----------------------------------------------

    I think Adobe actually own Phonegap.

  • ranma@

    I tried the center center option and it lines up on the x axis but it is still slightly out along the Y.

    Tom@

    <div class="wrapper">... canvas code ...</div>

    <style>

         .wrapper

         {

              width:332px;

              height:514px;

              background:url(smiley.gif);

              padding-top:122px;

         }

         </style>

    Where would I insert this in the following code?

    <style type="text/css">

    canvas {

        border: 1px solid red;

    }

    body {

        background-image: url("iPhone.gif");

        background-repeat: no-repeat;

        background-attachment: fixed;

        background-position:center center;

    }

         </style>

    <body>

         <div id="fb-root"></div>

         <div style="text-align: center;">

    Sorry to be a pain !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok I will play around with the CSS and try to get it positioned for you.

    I know that theses settings can can be used:

    <img src="http://dl.dropbox.com/u/22173473/align.png" border="0" />

    But I'm not sure how to implement it.

    (I need to spend a couple of hours reading up on it!)

  • chrisbrobs Your body needs to be defined in your CSS, and it needs to be separate from your canvas element.

    Something like this:

    <style type="text/css">

    canvas {

        border: 1px solid red;

    }

    body {

        background-image: url('iPhone.gif');

        background-repeat: no-repeat;

        background-attachment: fixed;

    }

         </style>

    I tried the above..it works, but it isn't centered ?

  • What doesn't work exactly? Make sure the URL to iPhone.gif is relative to the location of the index.html file (or css file if external)

    If you show me a demo page I can tell you what's wrong

    The files are here: iphone

    I just wanted a way to display an image surrounding the C2 Canvas

    in the browser window......I know you guys are busy, but if you get a spare minute would you have a look at it.

    Thanks in advance.

  • Can anybody tell me (Kyatric hopefully), whats wrong with following:

    <style type="text/css">

    canvas { border: 1px solid red; }

    {

    background-image:url('iPhone.gif');

    background-repeat:no-repeat;

    background-attachment:fixed;

    }

         </style>

    It doesnt work for some reason?

  • iPhone game template:

    iPhone capx template 240 x 320 layout size (window size 284 516)

    <img src="http://dl.dropbox.com/u/22173473/iphonesim.png" border="0">

    There is no tutorial, it doesnt really do anything except make your game look its running on an iPhone.

    Layer 1(top) is the iPhone image

    Layer 0 is where you build your game(240 x 320)

    I just added a simple block smashing thing to make it look better.

    Somebody might find it usefull?

    VIEW

    DOWNLOAD

    If you want any more info, let me know.

  • chrisbrobs: I see, so you used html5's audio tag. I was thinking more of doing it within C2, But you said you tried and didn't work. I guess we'll just have to wait and see if this is implemented later. Thank you.

    Also, very nice falling leaves effect!

    It might work, i just dont know what settings need to be added to get it to work? In the capx that comes with the plugin, there isn't an Audio example.If Jesse Johnston reads this, he might post an example?

  • Is it possible play music from a URL? I haven't found a way to do this, but maybe it's possible... if it's not possible, is there plans to make this possible? Perhaps a 3rd party plugin out there already?

    Ive been doing a bit of experimenting with regards to sounds, and there is way to play sounds if you add stuff to the index.html file.

    I added it to the bottom of my 'falling leaves' example...

    LEAVES

    Press play and a short audio file is loaded from my dropbox folder.

    I tried to do it with the html-elements plugin but couldnt get it to work.

    If you save the page, you can open it in a text editor to see how its done.

    This isnt a tutorial, its just something I have been playing around with.

  • I finally got it working :

    <img src="http://dl.dropbox.com/u/22173473/getcaproj.png" border="0" />

    I think by adding it as a sub event (as per your example) was the key.

    Thanks again.

  • Thanks for the example...works a treat. I will have to check the other events in my game.

    <img src="smileys/smiley1.gif" border="0" align="middle" />