Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

property "y" things #15620

Closed
s-h-i-f-t-y-z opened this issue Oct 3, 2024 · 12 comments
Closed

property "y" things #15620

s-h-i-f-t-y-z opened this issue Oct 3, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@s-h-i-f-t-y-z
Copy link

Describe your bug here.

i edited deleteCoolText in the title state so that instead of just spontaniously disappearing i made it so that it tweens to y 750, and compilation works but idk whenever it got to the part of the text disappearing it hit me with the error "The object does not have to property "y"".

heres part of the code i edited:

function deleteCoolText()
{
	while (textGroup.members.length > 0)
	{
		FlxTween.tween(credGroup, {y: 750}, 0.8, {ease: FlxEase.circOut});
		FlxTween.tween(textGroup, {y: 750}, 0.8, {ease: FlxEase.circOut});
		textGroup.remove(textGroup.members[0], true);
		credGroup.remove(textGroup.members[0], true);
	}
}

Command Prompt/Terminal logs (if existing)

flixel/tweens/misc/VarTween.hx (line 99)
flixel/tweens/misc/VarTween.hx (line 55)
flixel/tweens/FlxTween.hx (line 1099)
flixel/FlxGame.hx (line 745)
flixel/FlxGame.hx (line 677)
flixel/FlxGame.hx (line 545)
openfl/events/EventDispatcher.hx (line 402)
openfl/display/DisplayObject.hx (line 1399)

imagine getting: The object does not have the property "y"

Are you modding a build from source or with Lua?

Source

What is your build target?

Windows

Did you edit anything in this build? If so, mention or summarize your changes.

yes, i edited titlestate and added a new bg that replaces blackScreen, and edited the deleteCoolText so that it tweens instead

@s-h-i-f-t-y-z s-h-i-f-t-y-z added the bug Something isn't working label Oct 3, 2024
@MasterGamaDev
Copy link

why are you removing text before tween is completed?

@s-h-i-f-t-y-z
Copy link
Author

oh-

@MasterGamaDev
Copy link

oh-

have you tried it again?

@s-h-i-f-t-y-z
Copy link
Author

it still has that bug/error no matter what

@KELOTOMU
Copy link

textGroup.forEachExists(function (text:FlxBasic) {})
credGroup.forEachExists(function (cred:FlxBasic) {})

Try only using the textGroup forEachExists bc its the one that has all text, no other things unlike credGroup

@s-h-i-f-t-y-z
Copy link
Author

textGroup.forEachExists(function (text:FlxBasic) {}) credGroup.forEachExists(function (cred:FlxBasic) {})

Try only using the textGroup forEachExists bc its the one that has all text, no other things unlike credGroup

where should i put that/those lines of code in

like in the delete text function or addmore text or createcooltext

@KELOTOMU
Copy link

textGroup.forEachExists(function (text:FlxBasic) {}) credGroup.forEachExists(function (cred:FlxBasic) {})

Try only using the textGroup forEachExists bc its the one that has all text, no other things unlike credGroup

where should i put that/those lines of code in

like in the delete text function or addmore text or createcooltext

deleteCoolText

@s-h-i-f-t-y-z
Copy link
Author

textGroup.forEachExists(function (text:FlxBasic) {}) credGroup.forEachExists(function (cred:FlxBasic) {})
Try only using the textGroup forEachExists bc its the one that has all text, no other things unlike credGroup

where should i put that/those lines of code in
like in the delete text function or addmore text or createcooltext

deleteCoolText

what would this do/help with

@KELOTOMU
Copy link

textGroup.forEachExists(function (text:FlxBasic) {}) credGroup.forEachExists(function (cred:FlxBasic) {})
Try only using the textGroup forEachExists bc its the one that has all text, no other things unlike credGroup

where should i put that/those lines of code in
like in the delete text function or addmore text or createcooltext

deleteCoolText

what would this do/help with

inside the function for the foreach iteration u will add the tweens that u wanna do

@s-h-i-f-t-y-z
Copy link
Author

so credGroup is basically useless in the context of tweening the text out

@KELOTOMU
Copy link

so credGroup is basically useless in the context of tweening the text out

credGroup stores all stuff which is not only the text. u are trying to edit the text so when it disappears, it will do a tween instead of it getting destroyed, so its best to use textGroup instead of the credGroup to not mess up other stuff

@s-h-i-f-t-y-z
Copy link
Author

s-h-i-f-t-y-z commented Nov 2, 2024

so credGroup is basically useless in the context of tweening the text out

credGroup stores all stuff which is not only the text. u are trying to edit the text so when it disappears, it will do a tween instead of it getting destroyed, so its best to use textGroup instead of the credGroup to not mess up other stuff

so would it be
`function createCoolText(textArray:Array, ?offset:Float = 0)
{
for (i in 0...textArray.length)
{
var money:Alphabet = new Alphabet(0, 0, textArray[i], true);
money.screenCenter(X);
money.y += (i * 60) + 200 + offset;
if(credGroup != null && textGroup != null) {
credGroup.add(money);
textGroup.add(money);
}
textGroup.forEachExists(function (text:FlxBasic) {})
lxTween.tween(textGroup, {y: 0}, 0.8, {onComplete: onTweenFinished, ease: FlxEase.circOut});
}
}

function addMoreText(text:String, ?offset:Float = 0)
{
	if(textGroup != null && credGroup != null) {
		var coolText:Alphabet = new Alphabet(0, 0, text, true);
		coolText.screenCenter(X);
		coolText.y == (textGroup.length * 60) + 200 + offset;
		credGroup.add(coolText);
		textGroup.add(coolText);
	}
}

function deleteCoolText()
{
	while (textGroup.members.length > 0)
	{
		textGroup.forEachExists(function (text:FlxBasic) {})
		FlxTween.tween(textGroup, {y: 750}, 0.8, {, ease: FlxEase.circOut});
	}
}`

the reason i added the tween for onCreateText is so that it reappears

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants