Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - svintaj

Pages: 1 2 3 4 5
16
Extensions / SP_ValueMixer
« on: May 24, 2017, 08:41:46 am »
Hi, this is my first extension!  8) A small but useful one -> SP_ValueMixer:

Use SP_ValueMixer as an easy way to mix between any two values, value A mixes with value B, use a number between 0.0 and 1.0 to say how much of A shall mix with B.

These are the blocks I have created so far:

So as you can see,  you can also mix colors.

The green block Returns Number
And the blue block Returns Color

 SP_ValueMixer should work on all platforms, and I have only tested on Flash, Android and Windows.

Here is an example, where the MouseY position is used tofade between different values like, Position, Volume, Color:
<a href="http://www.segelson.com/Temp/Stencyl/FaderTest.swf" target="_blank" class="new_win">http://www.segelson.com/Temp/Stencyl/FaderTest.swf</a>
You can also find this Stencyl example project attached, named: FaderTest.stencyl.

How to install extensions: http://community.stencyl.com/index.php/topic,30432.0.html

Please show what you make with it! :D


 

17
Ask a Question / Re: Best way to save a separate file?
« on: May 21, 2017, 03:38:51 pm »
Thanks!  :) 

So I'm trying to learn this and I manage to save and load a text file on Windows, by modifying the code to this:
Code: [Select]
// Saving
var fo:sys.io.FileOutput = sys.io.File.write("test.txt", false);
fo.writeString("Just a Test...");
fo.close();

// Loading
var fi:haxe.io.Input = sys.io.File.read("test.txt", false);
_TestString = fi.readLine();
fi.close();
trace(_TestString);
(the file where created in the same folder as the exe file.)

While this code works nice on Windows,  the same code crashes on Android?
I also have added the  'WRITE_EXTERNAL_STORAGE permission' to the Androidmanifest, still crashing on Android...

Does anyone have any idea why?


18
Extensions / Re: Attribute Saving [Extension]
« on: May 20, 2017, 12:27:29 pm »
Thanks Yoplalala, since we are getting a bit of topic here I decided to move over to a new thread, please see: http://community.stencyl.com/index.php/topic,51520.0.html

19
Ask a Question / Re: Best way to save a separate file?
« on: May 20, 2017, 12:21:53 pm »
Ok, so Yoplalala was trying to help me from another thread, writing this:
Quote
Today at 06:08:53 am
Quote
Hi svintaj ! Sorry I didn't test how to do it. I'm trying Stencyl 3.5 and for now windows and android compiling doesn't work ... so quite difficult to test. Maybe I'll try on some old version.

(http://stackoverflow.com/questions/22630008/save-bitmapdata-bytearray-as-a-png-file)
Maybe this could help.
(image is an attribute of type image ;) )
// Saving the BitmapData
var b:ByteArray = image.encode("png", 1);
var fo:FileOutput = sys.io.File.write("test.png", true);
fo.writeString(b.toString());
fo.close();

Thanks Yoplalala, I'm new to this but I tried to put that in a Code Block, but when trying to compile I get those two errors:
'Type not found : ByteArray' and 'Type not found : FileOutput'?

20
Extensions / Re: Attribute Saving [Extension]
« on: May 20, 2017, 04:41:07 am »
Ok, so then I have a feature request to this Attribute Saving Extension :   8)

-> Could we have a 'Dropdown Menu' in all Save Blocks with the two options to save the file as a 'OneSharedObject' or an 'IndependentSingleFile*?  (For Android and iOS) That would be very usefull, and should totally solve my current issue previously described in this topic.

Also, -> when trying to save a big or many files, the app can crash, so it seems like we also need ~something to check for disk space to prevent such a crash?

21
Use 'ScaleToFit(Fullscreen)' and then just make your background actor a bit larger than the screen.
Also good to know: Apple rejected one of my apps when I used Letterbox, so I had to change it...

22
Ask a Question / Re: Firing in opposite direction of mouse (speed)
« on: May 19, 2017, 12:50:18 am »
Great! 8)

23
Ask a Question / Re: Slow ship wobble scene
« on: May 18, 2017, 12:25:20 pm »
Use the math function 'sin' to get a soft wave motion. Just feed an increasing value to 'sin'  and 'sin' will output a smooth wave between -1 and 1. Then just multiply the result to get the scale you need, like this: 'sin(IncreaseMe)*scale'

24
Ask a Question / Re: Firing in opposite direction of mouse (speed)
« on: May 18, 2017, 11:58:23 am »
This is how I did to get the distance between two coordinates 'MouseXY' and 'LastXY':

25
Ask a Question / Best way to save a separate file?
« on: May 18, 2017, 02:26:39 am »
Hello! :)

I need to be able save several images from within a painting app that I'm working on. I will also need to be able to load those images and delete them from within the app. I need this to work solid on both iOS and Android. ( I also would like to be able to first check if there is enough disk space on the device to save an image, before trying to save it, to prevent crashing. )

What is the best way to do this from Stencyl?

-> I have tried the "Attribute Saving"-extension, it works ok, but it does not seem to keep the files separated, so for each image I save it takes much longer time to save the next one. So all images seems to shear the same data. And I need to have it separated in some way. ( Also I'm clueless about how to see if there is enough disk space on the device, before saving an file. )

Please help with some ideas, thanks in advance!

26
Extensions / Re: Attribute Saving [Extension]
« on: May 12, 2017, 06:46:50 am »
Ok, no I "only" need my app to work on iOS and Android.

So please let me know what ways you are thinking about Yoplalala! I would love to hear how I may save one or more images, without having to save all my GameAttributes at the same time.

( I think I also would like to save the images to the device ordinary 'Camera roll' if it was possible, but I have not find any way to do that on both platforms so far... So I have instead done my own image 'gallery'/'browser' for now, with all saving, loading and deleting based on this useful 'Attribute Saving Extension'... but I have now found this strange sideeffect; that it takes a much longer time to save an image for each image that I save... )

27
Extensions / Re: Attribute Saving [Extension]
« on: May 11, 2017, 06:29:51 am »
Thanks for your help KramerGames, but I dont think its a memory leak in this case.

It's more 'like all images(files) share a SharedObject', even though I specify a unique name for each new image(file) in the 'file name/SharedObject' field?

Hm... can the 'data name' and 'file name'  have been mixed up internally within the block? I haven't tried to swich them around myself yet... but maybe I should, just to see if it works...

My problem is that: Saving takes much longer time for each saved image, the same with deleting images, the more images the longer time. Loading them goes however fast, even if I have a lot of images saved....??

28
Extensions / Re: Attribute Saving [Extension]
« on: April 21, 2017, 09:29:05 am »
Aslo, for each image I save, it takes much longer time to save it, It's like if every image has to be 're-saved'. The same happens when deleting an image, so if I have ten images saved it takes 10 times longer to delete one file? Is there something that can be done to aviod that? I really like to load, save and delete an image as 'one separate unit'. (To be able to save images in a gallery for a painting app)

Maybe there is a better way/Extention? But I need it to work on both Android and iOS?

29
Extensions / Re: Attribute Saving [Extension]
« on: April 01, 2017, 05:34:47 am »
@ShimieGames
I've updated the extension so that you can delete a field or delete anwhole save file

( the link can be seen by logged in users)

Great work GeorgeN and Yoplalala, thanks!

I can now manage to both save and load an image as well as delete it dynamically, by using the "image as text" and "text as image" blocks in Stencyl.

However I also would like to save and load image "as an image" to get a much greater load and save speed, is that something that someone can add to Yoplalala:s latest version?

Thanks in advance!

30
I also got this message today and have no idea right now what I can do to fix this?
So to the Stencyl developers; Can you read this thread and see if it makes any sense to you: http://stackoverflow.com/questions/38642622/google-play-warning-incorrect-implementation-of-google-play-inapp-billing

Thanks!

Pages: 1 2 3 4 5