limited-psychiatrist-77022
03/05/2023, 11:00 PMlimited-psychiatrist-77022
03/05/2023, 11:00 PMlimited-psychiatrist-77022
03/05/2023, 11:01 PMlimited-psychiatrist-77022
03/05/2023, 11:01 PMlimited-psychiatrist-77022
03/05/2023, 11:55 PMstraight-twilight-37046
03/06/2023, 12:38 AMstraight-twilight-37046
03/06/2023, 12:46 AMstraight-twilight-37046
03/06/2023, 12:48 AMvar iconXWide = icon.width;, and somehow manage to get the value of iconXWide, would it be set to the icon image's width?ambitious-knife-25690
03/06/2023, 12:50 AMambitious-knife-25690
03/06/2023, 12:50 AMstraight-twilight-37046
03/06/2023, 12:51 AMambitious-knife-25690
03/06/2023, 12:52 AMambitious-knife-25690
03/06/2023, 12:52 AMstraight-twilight-37046
03/06/2023, 12:52 AMnutritious-gold-52850
03/06/2023, 1:12 AMwitty-island-52596
03/06/2023, 1:27 AMnutritious-gold-52850
03/06/2023, 1:29 AMnutritious-gold-52850
03/06/2023, 1:30 AMhallowed-ocean-84954
03/06/2023, 1:55 AMnutritious-gold-52850
03/06/2023, 2:00 AMnutritious-gold-52850
03/06/2023, 2:19 AMhx
var encryptButton:FlxButton = new FlxButton(10, FlxG.height - 50, "Encrypt", function()
{
var newItem:ItemType = {
itemName: itemNameInput.text,
characterName: playerNameInput.text
}
var itemJson:String = Json.stringify(newItem);
itemJson = EncryptionKey.encryptData(itemJson);
trace("Code: " + itemJson); // string shows correctly here
// itemJson = EncryptionKey.decryptData(itemJson); // when decrypted, it copies correctly
System.setClipboard(itemJson); //encrypted string just sets clipboard to "S"
});
encrypting json:
hx
public static function encryptData(data:String):String
{
// make a new encoded string
var newString:String = "";
for (i in 0...data.length)
{
for (o in 0...normalAlphabet.length)
{
if (data.charAt(i).toString() == normalAlphabet[o])
{
newString += encryptedAlphabet[wrap(o, 1)];
break;
}
}
}
return newString;
}
wrap function (to loop around if necessary like a caesar cipher):
hx
static function wrap(index:Int, changeBy:Int):Int
{
for (i in 0...Std.int(Math.abs(changeBy)))
{
if (changeBy > 0)
{
index += 1;
}
else
{
index -= 1;
}
if (index > normalAlphabet.length - 1)
{
index = 0;
}
else if (index < 0)
{
index = normalAlphabet.length;
}
}
return index;
}witty-island-52596
03/06/2023, 2:27 AMwitty-island-52596
03/06/2023, 2:27 AMwitty-island-52596
03/06/2023, 2:28 AMnutritious-gold-52850
03/06/2023, 2:31 AMnutritious-gold-52850
03/06/2023, 2:31 AMwitty-island-52596
03/06/2023, 2:32 AMnutritious-gold-52850
03/06/2023, 2:32 AMwitty-island-52596
03/06/2023, 2:32 AMnutritious-gold-52850
03/06/2023, 2:32 AM