Gaming 3DS web browser tricks

ryanttb

Active Member
OP
Newcomer
Joined
Jun 14, 2011
Messages
30
Trophies
0
Location
Boston, MA
Website
surii.net
XP
120
Country
United States
input

With the help of a hidden, focused input (see sounds) we can get various levels of input based on the type of game screen you create. Here are the terms I've been using:

tiny
Only the bottom screen. Full D-Pad support as well as B and A buttons and single-tap on the touch screen.

skinny
Both screens, top screen is not in wide mode. D-Pad Left, Right and Down are fine. B & A and single-tap are as well. D-Pad Up bounces the screen.

tbone
Both screens, top screen is wide. D-Pad Down is ok. B & A and single-tap are as well. D-Pad Left, Right and Up bounce the screen. Left & Right are hard to recover from.

sounds

done
Make the download complete sound at any time. I'm calling it the "done" sound. It involves creating and then destroying an empty iframe. Here's the (updated) code (using jQuery, but could be done without it):

CODEÂÂ
ÂÂÂÂ$(function () {
ÂÂÂÂÂÂ$(document).keydown(function (e) {
ÂÂÂÂÂÂÂÂif (e.which == 13) {
ÂÂÂÂÂÂÂÂÂÂ$('').appendTo("body").remove();
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂ});
ÂÂÂÂ});
ÂÂ

cancel & ok
If you drop some HTML like the following:

CODE

and give the input focus you get both B and A button sounds when the player presses the buttons (though after each B button sound you have to reset the focus). I can't get these sounds to happen without player interaction.

move
If you keep focus on an input type=number surrounded on all sides by other inputs via either list items or a table, the D-Pad will make a new sound that I'm calling "move". Again, I can't make this sound without player interaction.

more

Get more info on my test site (new link as of 2011-09-28) http://surii.net/hack/

-ryanttb
 

ryanttb

Active Member
OP
Newcomer
Joined
Jun 14, 2011
Messages
30
Trophies
0
Location
Boston, MA
Website
surii.net
XP
120
Country
United States
If you touch and hold your stylus to the touch screen, the browser pops up a horrible "To select text," popup. The popup is not part of the DOM and takes up 90% of the top screen. It doesn't go away until you let go of the touch screen. While it's up, I get mouse events but can't see the top screen. I can't get rid of it. Might be ok for games using my "tiny" css class because those games won't use the top screen at all.

(I can actually make it go away by firing an alert() but then I don't get any more mouse events and the top popup is replaced by a popup on the bottom)
 

ryanttb

Active Member
OP
Newcomer
Joined
Jun 14, 2011
Messages
30
Trophies
0
Location
Boston, MA
Website
surii.net
XP
120
Country
United States
I just changed my "done" sound example to use the following embed instead:

CODE$('').appendTo("body").remove();

My thought was that the data URI wouldn't cause the browser to attempt a new request to the web server. Chrome's dev tools claim this works the exact same way as before network-wise but I feel better about it like this.
 

ryanttb

Active Member
OP
Newcomer
Joined
Jun 14, 2011
Messages
30
Trophies
0
Location
Boston, MA
Website
surii.net
XP
120
Country
United States
I missed the closing body tag. However, a completely empty iframe appears to have the same effect, so for completeness:

CODEÂÂ
ÂÂÂÂ$(function () {
ÂÂÂÂÂÂ$(document).keydown(function (e) {
ÂÂÂÂÂÂÂÂif (e.which == 13) {
ÂÂÂÂÂÂÂÂÂÂ$('').appendTo("body").remove();
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂ});
ÂÂÂÂ});
ÂÂ
 

ryanttb

Active Member
OP
Newcomer
Joined
Jun 14, 2011
Messages
30
Trophies
0
Location
Boston, MA
Website
surii.net
XP
120
Country
United States
KingVamp said:
Well interesting and cool. I'm going to follow this thread.

Name change?

I would like to. It says click and hold to edit the title but I've tried that in three browsers to no avail. Maybe a mod can change the topic title to "3DS browser tricks" or something for me?
 
Z

Zorua

Guest
ryanttb said:
KingVamp said:
Well interesting and cool. I'm going to follow this thread.

Name change?

I would like to. It says click and hold to edit the title but I've tried that in three browsers to no avail. Maybe a mod can change the topic title to "3DS browser tricks" or something for me?
Normal members can't change titles.
PM a mod or report the OP.
 

RedJiggly

Well-Known Member
Member
Joined
Jun 8, 2011
Messages
215
Trophies
0
Location
There
XP
96
Country
Netherlands
This truly is getting more and more amazing.

After my last project, wich I cannot post on here because of Copyright Infrigement, I'll try and make a simple RPG...
happy.gif
Should become interesting, when we can have sounds now.
smile.gif
 

thealeks

Well-Known Member
Newcomer
Joined
Jan 27, 2012
Messages
53
Trophies
0
XP
27
Country
United States
sounds

done
Make the download complete sound at any time. I'm calling it the "done" sound. It involves creating and then destroying an empty iframe. Here's the (updated) code (using jQuery, but could be done without it):


CODE


$(function () {
$(document).keydown(function (e) {
if (e.which == 13) {
$('').appendTo("body").remove();
}
});
});

would you be willing to write it without jquery? i've been trying to use it but it doesnt seem compatible with my javascript code.
 

McHaggis

Fackin' Troller
Member
Joined
Oct 24, 2008
Messages
1,749
Trophies
0
XP
1,466
Country
I missed the closing body tag. However, a completely empty iframe appears to have the same effect, so for completeness:

Code:
$(function () {
$(document).keydown(function (e) {
if (e.which == 13) {
$('').appendTo("body").remove();
}
});
});
You can actually just shorten it to

Code:
$('').appendTo("body").remove();
JavaScript and rendering occur on the same thread, so anything you add to the document will not appear until the JavaScript finishes executing. Since you add and then immediately remove it, it's never actually drawn on the screen.


would you be willing to write it without jquery? i've been trying to use it but it doesnt seem compatible with my javascript code.
It's not too difficult to convert the code to a pure JS/DOM solution:

Code:
document.onkeydown = function (evt) {
if (evt.which === 13) {
var ifr = document.body.appendChild(document.createElement("iframe"));
document.body.removeChild(ifr);
}
}

 

The Milkman

GBATemp's Official Asshat Milkman
Member
Joined
Jan 12, 2011
Messages
3,471
Trophies
0
Age
27
Location
Throwing milk at the bitches!
XP
1,337
Country
United States

would you be willing to write it without jquery? i've been trying to use it but it doesnt seem compatible with my javascript code.
It
I had a look into the 3DS's browser myself, it was one of the first things I did. However, I think the setup and the lack of a lot of functionality makes it inappropriate for web-based games. Fully utilizing both screens is awkward because you can't manipulate the scroll position of the document manually, you have to rely on the location hash. IIRC, you also can't lock the scrolling so creating a robust, dual-screen website is unlikely, even with CSS media queries.
What about media that's just formated to spand to both screen and uses Javascript elements to become interactive?
 

RedJiggly

Well-Known Member
Member
Joined
Jun 8, 2011
Messages
215
Trophies
0
Location
There
XP
96
Country
Netherlands
would you be willing to write it without jquery? i've been trying to use it but it doesnt seem compatible with my javascript code.
It
I had a look into the 3DS's browser myself, it was one of the first things I did. However, I think the setup and the lack of a lot of functionality makes it inappropriate for web-based games. Fully utilizing both screens is awkward because you can't manipulate the scroll position of the document manually, you have to rely on the location hash. IIRC, you also can't lock the scrolling so creating a robust, dual-screen website is unlikely, even with CSS media queries.
What about media that's just formated to spand to both screen and uses Javascript elements to become interactive?
Yes. Javascript and possibly HTML5, altough some DOM-based games may be faster. The main problem is that the screen-refresh rate of the 3DS is very low, so even if you run a game with 30 frames per second, the 3DS may still only show you three.

But it is possible, and especially some puzzle games or simple RPGs are able to work on the 3DS, even including Stylus control to drag stuff.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Sonic Angel Knight @ Sonic Angel Knight: :ninja: