Forum Replies Created
-
AuthorPosts
-
Actually I wonder if it was not the streaming functionality that was the reason why the files could not be in assets on some platforms, if that makes sense then I don’t understand what makes assets folders special are they the only ones that are internal and tge totally hidden folders of a game?
Would not any other files and directories be included in a apk for instance? In desktops assets are just really special paths as far as I can understand right now, they provide an easy way to hide things right?
About the subject of streaming music on different platforms and where to put everything correctly; I know that I need to do more testing but the testing procedure is superslow and I figure that people already know these things. I have to be honest the documents can be tricky to understand sometimes. I wished so much that they were simpler, it would make the whole experience much happier.
I made a list for anyone who might want to load and save files on the Android.
On the left is the name,on the right you see the path to put in your Monkeycode.
My files /All files = /storage/emulated/0/ (path here continues with Downloads, Playlists, Pictures etc)
Images = /storage/emulated/0/DCIM/Camera
Videos = same as above
Music = /storage/emulated/0/Music
Documents = /storage/emulated/0/Documents
Default Monkey2 (Externaldir command) = /storage/emulated/0/Android/data/com.monkey2.monkey2game
So,
device storage = /storage/emulated/0
SD memory card = /storage/extSdCard
This probably changes from models and versions but its good facts to begin an understanding how it works.
The next issue would be to place it correclty becuase that place was a thousand clicks away. I seriosly didn’t even knew there was such a place inside my phone called Android/data/blalbbala. But it is a great start
Thank you sooo much it did work i was just not looking at the right place !
I was looking at the root of the sd card but what happened was that external points to android/data/com.monkey2.monkey2game/files on the internal memory. (very much like ios does with some apps)
Also I checked that on the phones with a sdcard installed the same path is created but always empty. So external means the inbuilt memory/drive, with some special path added to match the name of the app.
This is what you get when you are new to these kind of things
it works !! other ppl had the same issue and that saved the day.
you have to pick build apk and not just rip the apk after pressing the green play button.
so relieved now.
So what gives I wonder because I use the same, the latest of everything, except going back one month to v 06 as 07 was weird in various ways (slow for the particular application im working on rigth now) .
Using samsung note2 and samsung note4
The path given on my Samsung Android phones is
/storage/emulated/0/Android/data/com.monkey2.monkey2game/files/
One had sdcard inserted one has not still both gives the same path from the External command.
I don’t know where to go from here to be able to load and save onto the card, have I missed something?
Clipping via hardware is effective but you are still limited to some kind of size probably 4k or so and you might need to stitch several ones to get the size you want.
It becomes the same tiling technique but at a ridiculues scale and you still need to handle world coordinates the same way.
it didn’t work in Android in Dekstop it saved a file in Monkeys own folder (not app folder but the main monkey folder) when you take away the /
Nnothing happens in either platform with the /
Do i have to give Android permissions to write somehow?
You can do extremely big worlds using this no problem. It is about 90 LOC and easy to understand.
Think I know what you mean I dont know much but this I know. Heres an example for you I made because I know this is abit tricky in the beginining buts its really easy when you see it in action.
The codebox is strange but I made the codefor my friend as tutorial. Here it is with proper formatting.
Monkey1234567891011121314151617181920212223Namespace Myapp #Import "<std>" #Import "<mojo>" #Import "assets/" Using std.. Using mojo..' This example assumes you have a 128x128 image ready with lots of 8x8 tiles in it, or it could be anything you'll still see the effect.Const w:=2732.0/2.0, h:=2048.0/2.0 ' Display resolution Class Myapp Extends WindowField canvas:Canvas Field image:Image Field s:Int, wx:Int, wy:IntField tilemap:Int[] = New Int[512*512] ' Create a world made of 512 x 512 tiles Field size:Int=32 ' Tilesize, change to anything you'd like Field xsprite:Int = 2000, ysprite:Int = 256, xd:Int = -4 ' An example of an enemyMethodNew( title:String="Myapp",width:Int=w,height:Int=h,flags:WindowFlags=WindowFlags.Resizable) Super.New("Myapp",w,h,flags)' Create a random example world of tiles For Local y:=0 To 511 For Local x:=0 To 511tilemap[x + y * 512] = Int(Rnd(127)) Next Next image=Image.Load("asset::128x1282.png", Null,Null) EndMethod OnRender( canvas:Canvas ) Override App.RequestRender()canvas.Clear(Color.Black) Local scrx:=wx Mod size Local scry:=wy Mod size Local mapx:=wx / size Local mapy:=wy / size Local cnty:= -scry For Local y:=mapy To (mapy+(h/size)+1) Local cntx:=-scrx For Local x:=mapx To (mapx+(w/size)+1) Local char:= tilemap[x + y * 128] Local tilex:= char & 7 Local tiley:= char Shr 3 canvas.DrawRect(cntx,cnty,size,size,image,tilex Shl 3,tiley Shl 3,8,8)' Hardcoded to get its sprites from a 128x128px tilesheet made up of 8x8px tiles (Shl 3 = * 8) cntx=cntx+sizeNext cnty=cnty+size Next ' Do something like checking for exit and create some movement.If Keyboard.KeyReleased(Key.Escape) Then App.Terminate()' Put a slow automatic scrolling to the right of the world wx=wx+1' Add manual scrolling using cursor keys Local s:=4 ' Manual scrollspeed wx = wx - s * Int(Keyboard.KeyDown(Key.Left)) + s *Int(Keyboard.KeyDown(Key.Right)) wy = wy - s * Int(Keyboard.KeyDown(Key.Up)) + s *Int(Keyboard.KeyDown(Key.Down)) wx=Max(0,Min(10000,wx)) ; wy=Max(0,Min(10000,wy)) ' Limit the world woordinates to stay within 0-10000 (change this to what you like)' Create a simple back and forth enemy-pattern to have something to look at xsprite= xsprite + xdIf xsprite > 2900 Then xd = - xd If xsprite < 700 Then xd=-xd' Put enemies and objects into the world using this sx sy style of coordinates Local sx:=xsprite-wx Local sy:=ysprite-wy canvas.DrawRect(sx,sy,size,size,image,2 Shl 3, 2 Shl 3,8,8)canvas.Flush() End MethodEnd Function Main()New AppInstance New Myapp App.Run()I am learning Monkey2 going from desktop now to tablets i reliase I need to understand how save textfile on Androids sdcard. Is it possible? I just need the smallest banana how to do such a thing and i can learn from that i think.
The debug mode is going so much slower in Julys compared to Junes version is this temporary will it go back to full speed in later versions again?
i domt mind to much in debug but theres also small differences in rleease mode and i am concerned about the lowered speed.
we reinstalled June now to solve it for the moment.
What about macos not having opengl in the next version will that affect Monkey2 s ability to sell in stores if the forbid new apps woth opengl instead of metal2?
I can’t get this to work on my windows tablet am I missing something?
I can activate the onscreen keys by hand but csn’t show or hide it programmatically using SDL commands?
Do I need to open a SDL display instead of using a normal canvas ? (it works and it works with normal canvas on android, but nit windows)
-
AuthorPosts