{"id":52962,"date":"2021-08-09T03:01:34","date_gmt":"2021-08-08T17:01:34","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=52962"},"modified":"2021-08-09T11:49:00","modified_gmt":"2021-08-09T01:49:00","slug":"emoji-in-sector-game-resize-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/emoji-in-sector-game-resize-tutorial\/","title":{"rendered":"Emoji in Sector Game Resize Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Keyboard Split on iPad Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/\/HTMLCSS\/emoji_in_sector_resize.jpg\" title=\"Keyboard Split on iPad Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Emoji in Sector Game Resize Tutorial<\/p><\/div>\n<p>We find the &#8220;onresize&#8221; event one of the most interesting to code for with web applications.  It can be a minor tweak right through to scenarios where it is just too hard not to &#8230;<\/p>\n<p><code><br \/>\nlocation.href=document.URL;  \/\/ the onresize coward's way out<br \/>\n<\/code><\/p>\n<p>.  And so, onto yesterday&#8217;s <a title='Emoji in Sector Game Primer Tutorial' href='#esgpt'>Emoji in Sector Game Primer Tutorial<\/a> we have a reasonably complex scenario catering for this &#8220;web browser window size change via user means&#8221; event (logic) &#8230; HTML <font color=blue>change<\/font> &#8230;<\/p>\n<p><code><br \/>\n&lt;body onload='wwt=window.innerHeight; onl();' onkeypress=\"vslast(event);\"<font color=blue> onresize=\"pretwf();\"<\/font>&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; using Javascript &#8220;onresize&#8221; event logic &#8230;<\/p>\n<p><code><br \/>\nfunction pretwf() {<br \/>\n  myt=null;<br \/>\n  myz=null;<br \/>\n  thetds=[];<br \/>\n  thetdareas=[];<br \/>\n  \/\/thetdids=[];<br \/>\n  \/\/theclasses=[];<br \/>\n  thels=[];<br \/>\n  thets=[];<br \/>\n  thegridtdareas=[];<br \/>\n  thegridtdihs=[];<br \/>\n  obr=true;<br \/>\n  document.getElementById('emj').innerHTML='';<br \/>\n  for (var iij=0; iij&lt;numplayers; iij++) {<br \/>\n  document.getElementById('t' + iij).style.height='calc(60vh ' + ('- ' + eval(wwt - window.innerHeight)).replace('- -','+ ') + 'px)';<br \/>\n  }<br \/>\n  setTimeout(twf, 700);<br \/>\n}<br \/>\n<\/code><\/p>\n<p>Adding to our interest <font size=1>(and smug satisfaction, let&#8217;s face it)<\/font> is anytime we can involve CSS <a target=_blank title='CSS3 calc information' href='https:\/\/www.htmlgoodies.com\/html5\/css\/using-the-css3-calc-function.html'>calc<\/a> and the height <a target=_blank title='CSS vh unit' href='https:\/\/www.google.com\/search?q=vh+unit+css&#038;rlz=1C5CHFA_enAU832AU832&#038;oq=vh+unit+css&#038;aqs=chrome.0.0i512j0i22i30l2.4356j0j4&#038;sourceid=chrome&#038;ie=UTF-8'>vh<\/a> unit.<\/p>\n<p>Again, feel free to try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html-GETME\" title=\"emoji_in_sector.html\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html-GETME\" title=\"emoji_in_sector.html\">emoji_in_sector.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html\" title=\"Click picture\">live run<\/a> link.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/emoji-in-sector-game-resize-tutorial\/'>Emoji in Sector Game Resize Tutorial<\/a>.<\/p-->\n<hr>\n<p id='esgpt'>Previous relevant <a target=_blank title='Emoji in Sector Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/emoji-in-sector-game-primer-tutorial\/'>Emoji in Sector Game Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Emoji in Sector Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/\/HTMLCSS\/emoji_in_sector.jpg\" title=\"Emoji in Sector Game Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Emoji in Sector Game Primer Tutorial<\/p><\/div>\n<p>We&#8217;re continuing on with the <i>&#8220;style=position:fixed&#8221;<\/i> theme of recent times.  We&#8217;ve got for you a first draft of a &#8220;reactions game&#8221; called &#8220;Emojis in Section&#8221; where up to 5 players are presented with &#8230;<\/p>\n<ul>\n<li>a 5&#215;5 grid of interest for each (up to five) player(s)<\/li>\n<li>overlayed by a fast moving fruit emoji <font siez=1>(as you would)<\/font> via <i>&#8220;style=position:fixed&#8221;<\/i> &#8230; and &#8230;<\/li>\n<li>the player scores by timing their nomination of a grid rectangle letter name with when the fruit emoji is within that grid rectangle, else use &#8220;z&#8221; for the slivers of area not within the grid rectangles<\/li>\n<\/ul>\n<p>Just the one computer or device, so how can two or more (we allow for up to five) play?   Well, on non-mobile we allow a button press versus keyboard paradigm for a two player game, else all keyboard accesses for users.  We&#8217;ll see about other scenarios as the days go on.<\/p>\n<p>Feel free to try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html_GETME\" title=\"emoji_in_sector.html\">emoji_in_sector.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emoji_in_sector.html\" title=\"Click picture\">live run<\/a> link.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d52953' onclick='var dv=document.getElementById(\"d52953\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d52953' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d52953' onclick='var dv=document.getElementById(\"d52953\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d52953' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We find the &#8220;onresize&#8221; event one of the most interesting to code for with web applications. It can be a minor tweak right through to scenarios where it is just too hard not to &#8230; location.href=document.URL; \/\/ the onresize coward&#8217;s &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/emoji-in-sector-game-resize-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[174,385,400,3037,476,477,2298,576,652,673,1578,894,1988,997,3390,1319],"class_list":["post-52962","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-button","tag-emoji","tag-event","tag-fixed","tag-game","tag-games-2","tag-grid","tag-html","tag-javascript","tag-keyboard","tag-onresize","tag-overlay","tag-position","tag-programming","tag-reactions","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/52962"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=52962"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/52962\/revisions"}],"predecessor-version":[{"id":52967,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/52962\/revisions\/52967"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=52962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=52962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=52962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}