I'm working on a feature for an app that I'm developing that involves shuffling an array, and I'd like to provide an option for the user to provide their own random seed for the built in shuffle() method. I've been testing it with just some random pngs still sitting in my project folder. Bear with me as I'm pretty new at programming in general, let alone godot, but this is as far as I could get(nodes here don't really matter, it's just some buttons and richtextlabels):
func _on_shufflefromimage1_pressed():
var image_1_as_image = image1.get_data()
var image_1_as_pool_byte_a = image_1_as_image.data.data
var image_1_hash = hash(image_1_as_pool_byte_a)
$rn/randomnumber.text = str(image_1_hash)
seed(image_1_hash)
var deck_copy = global.deck.duplicate()
deck_copy.shuffle()
var deck_copy_indexed = []
for i in deck_copy:
deck_copy_indexed.append(global.deck.find(i))
$sai/shuffledarrayindexes.text = str(deck_copy_indexed)
The first problem is that get_string_from_ascii returns nothing, no error, just blank. If I add print(image_1_as_pool_byte_a.get_string_from_ascii()) at the end and click (shufflefromimage1) there is no printout.
The second(potential?) problem is how would this be managed from an iOS standpoint? Different iOS versions provide different image formats. Between different iOS versions, the images produced can be jpg, png, or HEIC depending on if its
a screenshot, an image capture from the camera, some even TIFF. I'm a bit of a newb at mobile development, so can this idea still work?