Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879570 Posts in 32989 Topics- by 24370 Members - Latest Member: kara

May 24, 2013, 10:50:04 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)This Stupid Textbox. (I'm dying)
Pages: [1]
Print
Author Topic: This Stupid Textbox. (I'm dying)  (Read 436 times)
Mir@k
Level 1
*


Nothing becomes something


View Profile WWW
« on: April 17, 2011, 01:21:54 AM »

Moved to yoyogames.
« Last Edit: April 17, 2011, 09:39:39 PM by Mir@k » Logged

nikki
Level 10
*****


View Profile Email
« Reply #1 on: April 17, 2011, 05:03:23 AM »

i don't know GM, but i think i have a nice tip:
rewrite your code with more meaningful names.

for example x2 = width ?? why not use the name width ?
and this :
Quote
var x1, y1, x2, y2, text, mar, spd, bcol1, bcol2, fcol1, fcol2, tcol1, tcol2;
var tlength, line_break, tchr, tchr_prev, tchr_next, tchr_w, tword_w, tword, ti, tw, th, thick, ckey, cspr, old_alpha;
var tword_chrprev, tword_pos, tpart, text_height, sprite, img, sw, sh;

almost every name in this block is unclear to me (apart from text , sprite and image (and ok x1 and y1))

I believe if you refactor that stuff a bit the problem you encounter is an easy fix...

oh and this line :
Quote
TextBox(o_superpantito.x-32,o_superpantito.y+64,o_superpantito.x+224,o_superpantito.y-32,'THIS IS THE TEXTBOX!',s_panthab,0);
seems to rely so heavily on the 'o_superpantito' instance of whatever it is, i think it'd be better to feed it the instance directly (and do those calculations in the body instead of on the parameters)  just my 2c's
Logged
Mir@k
Level 1
*


Nothing becomes something


View Profile WWW
« Reply #2 on: April 17, 2011, 11:47:24 AM »

I forgot to mention, but relying on o_superpantito isn't the problem. Even if i used direct coordinates, or if i used view_xview[0], the problem is the same.

Nikki, i don't want to appear as an ungrateful twit, but my problem does not lie in the way i name my variables, but the way game maker handles screen_redraw and refresh. I removed both of these but the script won't run that way. However in the future i will try to rename all my variables simpler names so others don't have a hard time finding stuff when i screw up. Thank you for your tip and input. =)
« Last Edit: April 17, 2011, 12:35:39 PM by Mir@k » Logged

teh_ham
Level 0
**



View Profile Email
« Reply #3 on: April 17, 2011, 02:32:37 PM »

No offense but your code is very unreadable.

Anyways, you should try and isolate the problem; Are the arguments you're passing to the script correct? Hit F6, go into debug mode, and find out.
Logged
Mir@k
Level 1
*


Nothing becomes something


View Profile WWW
« Reply #4 on: April 17, 2011, 09:38:41 PM »

Guys, really. Do you think i'd make a thread in this place if i haven't tried any of the most obvious things you must try? Suggesting using debug mode? SERIOUSLY?

Anyway forget it. I posted this same thread in the yoyogames forum, which i've seen some users here bash relentlessly for being populated by "script kiddies", and got the help i needed, you know, people who wanted to help me solve my problem instead of people telling me to clean the code and suggest some other useless crap i didn't have troubles with.

I guess my place is there, with people who find my unreadable code readable.

You guys aren't usually like this. A big disappointment. :S
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic