diff options
| author | Ray <[email protected]> | 2019-05-20 21:57:55 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-20 21:57:55 +0200 |
| commit | 1dae9d9af3820d58b7a6d71d63d1cd000ca1da45 (patch) | |
| tree | 517eb82b1ae6c22840c7b945992ac647217947b3 | |
| parent | e9f7fac3afad35dafeff01695539393a54d0dd9b (diff) | |
| download | raylib.com-1dae9d9af3820d58b7a6d71d63d1cd000ca1da45.tar.gz raylib.com-1dae9d9af3820d58b7a6d71d63d1cd000ca1da45.zip | |
Add physac examples
Improved modules
| -rw-r--r-- | common/examples.css | 25 | ||||
| -rw-r--r-- | common/examples.js | 10 | ||||
| -rw-r--r-- | examples.html | 3 | ||||
| -rw-r--r-- | examples/web/core/loader.html | 3 | ||||
| -rw-r--r-- | examples/web/physac/loader.html | 6 |
5 files changed, 31 insertions, 16 deletions
diff --git a/common/examples.css b/common/examples.css index c2397a4..a884d71 100644 --- a/common/examples.css +++ b/common/examples.css @@ -1,9 +1,9 @@ #container .mix{ position: relative; display: none; } #container .extext { top: 160px!important; width: 400px!important; } -#filter_menu { width: 820px; height: 80px; margin-left: 18px; } +#filter_menu { width:820px; height:80px; margin-left:15px; } -.legendButton { float:left; margin-right:10px; margin-bottom:20px; width:90px; height:80px; text-align: center; } +.legendButton { float:left; margin-right:8px; margin-bottom:20px; width:84px; height:75px; text-align:right; line-height:120px; } #core { cursor:pointer; background-color:#e1e1e1; color:#5c5a5a; border:5px solid #898888; } #shapes { cursor:pointer; background-color:#f0d6d6; color:#c55757; border:5px solid #e66666; } #textures { cursor:pointer; background-color:#c8eabf; color:#60815a; border:5px solid #75a06d; } @@ -11,13 +11,16 @@ #models { cursor:pointer; background-color:#bedce8; color:#417794; border:5px solid #5d9cbd; } #shaders { cursor:pointer; background-color:#e2c3f5; color:#a864d2; border:5px solid #a864d2; } #audio { cursor:pointer; background-color:#ebddae; color:#8c7539; border:5px solid #d3b157; } +#physics { cursor:pointer; background-color:#ddffdd; color:#00a820; border:5px solid #00a820; } -.core:hover { background-color:#e1e1e1; color:#5c5a5a; border:4px solid #898888; } -.shapes:hover { background-color:#f0d6d6; color:#c55757; border:4px solid #e66666; } -.textures:hover { background-color:#c8eabf; color:#60815a; border:4px solid #75a06d; } -.text:hover { background-color:#bef0dd; color:#377764; border:4px solid #52b296; } -.models:hover { background-color:#bedce8; color:#417794; border:4px solid #5d9cbd; } -.audio:hover { background-color:#ebddae; color:#8c7539; border:4px solid #d3b157; } +#core:hover { border-color:black; } +#shapes:hover { border-color:black; } +#textures:hover { border-color:black; } +#text:hover { border-color:black; } +#models:hover { border-color:black; } +#shaders:hover { border-color:black; } +#audio:hover { border-color:black; } +#physics:hover { border-color:black; } .fcore { border: 1px solid #898888; margin-left: 12px; } .fshapes { border: 1px solid #e66666; margin-left: 12px; } @@ -26,6 +29,7 @@ .fmodels { border: 1px solid #5d9cbd; margin-left: 12px; } .fshaders { border: 1px solid #a864d2; margin-left: 12px; } .faudio { border: 1px solid #d3b157; margin-left: 12px; } +.fphysac { border: 1px solid #00a820; margin-left: 12px; } .fcore p { color:#5c5a5a!important; } .fshapes p { color:#c55757!important; } @@ -34,6 +38,7 @@ .fmodels p { color:#417794!important; } .fshaders p { color:#a864d2!important; } .faudio p { color:#8c7539!important; } +.fphysac p { color:#00a820!important; } #container .fcore a img, #container .fcore a { border: none; overflow: hidden; float: left; background-color: #e1e1e1; opacity: 1; } #container .fcore a:hover { border: 10px solid #898888; } @@ -63,4 +68,8 @@ #container .faudio a:hover { border: 10px solid #d3b157; } #container .faudio a:hover img { margin: -10px; opacity: 0.3; } +#container .fphysac a img, #container .fphysac a { border: none; overflow: hidden; float: left; background-color: #ebddae; opacity: 1; } +#container .fphysac a:hover { border: 10px solid #d3b157; } +#container .fphysac a:hover img { margin: -10px; opacity: 0.3; } + #container .extext { position:absolute; top:140px; width:320px; text-align: center; display: none; }
\ No newline at end of file diff --git a/common/examples.js b/common/examples.js index 7e63392..32ee495 100644 --- a/common/examples.js +++ b/common/examples.js @@ -94,13 +94,20 @@ $(document).ready(function() { 'audio_module_playing', 'audio_music_stream', 'audio_raw_stream', - 'audio_sound_loading']; + 'audio_sound_loading', + 'physics_demo', + 'physics_friction', + 'physics_movement', + 'physics_restitution', + 'physics_shatter']; for (var i = 0; i < exampleName.length; i++) { var filterType = exampleName[i].substring(0, exampleName[i].indexOf("_")); var exampleBase = exampleName[i].slice(exampleName[i].indexOf('_') + 1); var exampleDesc = exampleBase.replace('_', ' '); + + if (filterType == "physics") filterType = "physac"; $('#container').append( '<div class="mix f' + filterType + '">' + @@ -117,7 +124,6 @@ $(document).ready(function() { $("#container a").hover( function(){ $(this).find(".extext").show(); }, function(){ $(this).find(".extext").hide(); }); - /* $("#container a img").hover( function() { $(this).stop().animate({ opacity:0.6 }, 200, "easeOutQuad" ); }, diff --git a/examples.html b/examples.html index ecace1f..47e9895 100644 --- a/examples.html +++ b/examples.html @@ -88,7 +88,8 @@ <div class="filter legendButton" id="text" data-filter=".ftext">text</div> <div class="filter legendButton" id="models" data-filter=".fmodels">models</div> <div class="filter legendButton" id="shaders" data-filter=".fshaders">shaders</div> - <div class="filter legendButton" id="audio" data-filter=".faudio">audio</div> + <div class="filter legendButton" id="audio" data-filter=".faudio">raudio</div> + <div class="filter legendButton" id="physics" data-filter=".fphysac">physac</div> </div> <!-- Items container, filled when loading --> diff --git a/examples/web/core/loader.html b/examples/web/core/loader.html index affc6c8..bc8187b 100644 --- a/examples/web/core/loader.html +++ b/examples/web/core/loader.html @@ -74,8 +74,7 @@ }, 'text'); // Quick hack for some examples not working on web - if ((name == "core_drop_files") || - (name == "core_storage_values")) + if (0) { $('#eximage').append('<img src="' + imgUrl + '" alt=" ">'); } diff --git a/examples/web/physac/loader.html b/examples/web/physac/loader.html index affc6c8..368a5e2 100644 --- a/examples/web/physac/loader.html +++ b/examples/web/physac/loader.html @@ -58,13 +58,13 @@ document.title = "raylib - " + name.replace('_', ' '); - var type = name.substring(0, name.indexOf("_")); + //var type = name.substring(0, name.indexOf("_")); //var srcUrl = '../../src/' + type + '/' + name + '.c'; //var imgUrl = '../' + type + '/' + name + '.png'; // Get example code and image directly from original raylib GitHub and avoid duplicate code to maintain - var srcUrl = 'https://raw.githubusercontent.com/raysan5/raylib/master/examples/' + type + '/' + name + '.c'; - var imgUrl = 'https://raw.githubusercontent.com/raysan5/raylib/master/examples/' + type + '/' + name + '.png'; + var srcUrl = 'https://raw.githubusercontent.com/raysan5/raylib/master/examples/physac/' + name + '.c'; + var imgUrl = 'https://raw.githubusercontent.com/raysan5/raylib/master/examples/physac/' + name + '.png'; $('#eximage img').attr('src', imgUrl); |
