How do I store the built parts of my sprites....

Get help using Construct 2

Post » Tue Jun 21, 2016 8:10 am

First, please excuse my English because I am not good at it :D

I am creating a mobile game that look likes build your robot. But I don't know how to make "SAVE" the screenshot of your finished robot and how to make a gallery to view the screenshot of your finished robots.

Thanks. :D
Hoping for replies :D
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Tue Jun 21, 2016 9:17 am

You can take screenshots of the canvas using the system action "Snapshot canvas".

Otherwise, instead of actual images, you could save the position and animation frame of each sprite composing your robot (in a data structure like an array or something) and display it accordingly in your game.

For that, I guess you should look into the local storage and existing examples on how to save/load the data, and create some functions to help you saving and displaying the robot accordingly.


Also no need to bump your topic after one hour.
Do researches on your own, and if in 24 hours there is nothing new, bump is authorized, not before.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Tue Jun 21, 2016 9:26 am

Message: clarkkentnicdao can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
Kyatric wrote:You can take screenshots of the canvas using the https://www.scirra.com/manual/125/system-actions system action "Snapshot canvas".

Otherwise, instead of actual images, you could save the position and animation frame of each sprite composing your robot (in a data structure like an https://www.scirra.com/manual/108/array array or something) and display it accordingly in your game.

For that, I guess you should look into the https://www.scirra.com/manual/188/local-storage]local storage[/url] and existing examples on how to save/load the data, and create some [url=https://www.scirra.com/manual/149/function functions to help you saving and displaying the robot accordingly.


Also no need to bump your topic after one hour.
Do researches on your own, and if in 24 hours there is nothing new, bump is authorized, not before.


I see.. Thanks.. I will try what you said.
One question... Screenshots is working on mobile? If yes I humbly asking if you have capx or link for that? :D

Last.. sorry if i bumped it... :D
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Tue Jun 21, 2016 1:23 pm

It works. You use the system action, it takes your whole canvas as a screenshot and there is a "On canvas snapshot" system condition you can use to trigger actions when the snapshot is taken.
And you have access to your screenshot as an URI using the system expression "CanvasSnapshot".

Reading the description for all those in the manual do help.
See this topic. Not exactly the same as what you want, but it shows snapshot in action.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Wed Jun 22, 2016 1:01 am

Message: clarkkentnicdao can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
Kyatric wrote:It works. You use the system action, it takes your whole canvas as a screenshot and there is a "On canvas snapshot" https://www.scirra.com/manual/124/system-conditions system condition you can use to trigger actions when the snapshot is taken.
And you have access to your screenshot as an URI using the https://www.scirra.com/manual/126/system-expressions system expression "CanvasSnapshot".

Reading the description for all those in the manual do help.
See https://www.scirra.com/forum/how-do-i-create-multiple-snapshots_t177844 this topic. Not exactly the same as what you want, but it shows snapshot in action.


Thanks! I will look at it :D
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Wed Jun 22, 2016 5:29 am

Message: clarkkentnicdao can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
Kyatric wrote:It works. You use the system action, it takes your whole canvas as a screenshot and there is a "On canvas snapshot" https://www.scirra.com/manual/124/system-conditions system condition you can use to trigger actions when the snapshot is taken.
And you have access to your screenshot as an URI using the https://www.scirra.com/manual/126/system-expressions system expression "CanvasSnapshot".

Reading the description for all those in the manual do help.
See https://www.scirra.com/forum/how-do-i-create-multiple-snapshots_t177844 this topic. Not exactly the same as what you want, but it shows snapshot in action.


sadly screenshot didn't work on my android :( it didn't save anywhere :(
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Wed Jun 22, 2016 9:18 am

You get an URI, then it is up to you to do something with it.
You either download it using the Browser plugin.
Or send it to an online server of your choice using AJAX.

When you take the snapshot, it is just a line of text you have to do something with.

When you mention Android, do you mean exported as a Cordova application or executed in a browser on Android ?
The execution in browser will work as is. Exported as Cordova might require you to add some Cordova plugin to your converting tool.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Wed Jun 22, 2016 9:55 am

Kyatric wrote:You get an URI, then it is up to you to do something with it.
You either download it using the Browser plugin.
Or send it to an online server of your choice using AJAX.

When you take the snapshot, it is just a line of text you have to do something with.

When you mention Android, do you mean exported as a Cordova application or executed in a browser on Android ?
The execution in browser will work as is. Exported as Cordova might require you to add some Cordova plugin to your converting tool.


yup i exported it to apk using intel xdk 3400.. May I know what cordova plugin may i use.. I am working for this screenshot on android for how many days. :( and how to add it to my converting tool?
Thanks a lot for your reply everytime.. :(
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Thu Jun 23, 2016 9:25 am

clarkkentnicdao wrote:May I know what cordova plugin may i use.. I am working for this screenshot on android for how many days. :( and how to add it to my converting tool?
Thanks a lot for your reply everytime.. :(


I don't know. I only said it might be required.
Plugins in XDK are added as indicated in this tutorial's page.
I'm afraid working on features for days is part of game development.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Thu Jun 23, 2016 10:04 am

Kyatric wrote:
clarkkentnicdao wrote:May I know what cordova plugin may i use.. I am working for this screenshot on android for how many days. :( and how to add it to my converting tool?
Thanks a lot for your reply everytime.. :(


I don't know. I only said it might be required.
Plugins in XDK are added as indicated in this tutorial's page.
I'm afraid working on features for days is part of game development.


Thanks a lot.. I hope i will figure this out and i will share it here quickly :D
B
79
S
31
G
7
Posts: 148
Reputation: 9,179


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, Google [Bot], ignaciosimo, nickar and 40 guests