How do I create mobile touchsreen scroll top to bottom controls for reading game app

Hello,

I am creating a mobile (android) quiz game using the quiz extension. This game also has a scene (Study) where you just read explanatory texts. I have created all the text needed for each chapter such that it should be read in a single flow by simply scrolling top to bottom (or bottom to top) using your fingers as you would possibly scroll on your phone when going through a website.

But I am stuck! :thinking: I have searched the forum and youtube but found no help. Touchsrceen not working and Preview blank.

Here is what I have done:

  1. Installed DragCameraWithPointer Extension
  2. Created a text object and put in “ALL” my text in it like this below.
  3. These are the properties of my text object
  4. These are the actions I have created

The preview returns a blank screen when I run the game from the start on computer and mobile. But if I preview the scene alone, I can see it correctly.
5. Earlier, I did not add the enforce camera boundaries action. It keeps scrolling all the way without limits on mobile and I could preview it…

I don’t know if the touchscreen control is even working at all now. Please help urgently.

Thank you for all your help

Hi there,
So the scrolling you want works fine when you preview just that scene, but if you start the preview from another scene and reach that scene, nothing shows?
Is that only in preview, or in exported version only, or both?

Hi @Gruk the scrolling does not work either in only that scene preview or from preview from another scene to that scene. The blank screen also happens in the apk file tested on my phone.

Is there a possibility that the enforce camera boundaries are not correct…or the way the text object is set on editor (in a single flow)…or a wrong Z Order or…wrong Layer?

What is your game resolution in settings? I was assuming your resolution was 600 so the right enforcement was less than the game resolution so I tried enforcing the same less than screen width boundary in a game I’m working on, but I could still see my objects, they were just off to the side. (I was just using preview though, I didn’t export the game and then try it). Anyway I think enforcing the right border isn’t needed if you’re just enabling a vertical drag.

You can try a higher zorder but since it’s on it’s own layer it should be seen as long as it’s a top layer. I suppose you are making sure that layer is visible.

@Lucky-j thanks for your kind response. The game is portrait orientation with resolution 720:1280. I am thinking too that their might be too much offset to the right that’s why it seems blank. The layer is visible too.

Can you please confirm that the way the texts simply flow beyond the orientation is the right way to do it.

How do I call the right values for the borders/boundaries? I simply put my cursor to the bottom of the text placeholder to the right and inputted the values I saw :grinning:

Well you did it right to find the values you wanted for the bottom. The right won’t matter because you’re not letting anyone drag your layer horizontally, so it won’t move right. If your resolution is 720 you can try putting that instead and see. When I was trying it I could still see the objects on screen but they were all pushed off to the side, and the scrolling worked. This was only in preview though. I made a huge text box, put it on a layer, enabled drag vertical to the layer, enforced boundary like yours, put the zorder to 1. It all seems to be working. I did add some room to the bottom boundary because it made the last line hard to read if it was right at the window bottom edge. Mouse and touchscreen both worked. I’m stumped. Maybe it only works in preview or the something else in the game is what’s not working. Toggle disable all that and see if you still get a blank screen.

@Lucky-j @Gruk I made another game just for the touchscreen scene. It works well on preview and exported version for android. I made another with 2 scenes - a start scene and touchscreen scene. I made a third game with 2 scenes and the 3rd screen which is the touchscreen scene. Both the preview and exported versions are blank.

So, I made a project, two scenes, one with a button to access the second scene, and in the second scene, a big text object and the same actions:



I can start the project from either scene, the text displays and the scrolling works fine.

Did you specify the camera number in each action, as I did?
Did you use a standard text object, or a BBCode or Bitmap ?

There shouldn’t be any difference, starting your scene as preview or starting from another scene, except if you have actions in that first scene affecting the second scene…

@Gruk thank you for responding always.

I did exactly as specified - using default camera 0 in each action, as well as a standard text object.

In my last response, 2 scenes worked pretty well but not 3 scenes where the 3rd scene is the text scene with touchscreen.

Would you want to check out using 3 scenes?

Thank you for your help always.

Works all the same for me.
Feel free to take a look (ignore the disabled mess) and replace with your own elements until you find the issue.

@Gruk I appreciate your kind help.