Window_Selectable throws a formatting error in external editor. Why?

Bethins

Villager
Member
Joined
Nov 4, 2012
Messages
69
Reaction score
0
First Language
English
Primarily Uses
def item_rect(index)

rect = Rect.new

rect.width = item_width

rect.height = item_height

rect.x = index % col_max * (item_width + spacing)

rect.y = index / col_max * item_height

rect

end

I'm still learning and would like to understand why the "/" in the rect.y line throws the formatting off for the rest of the script in notepad ++.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
this is normal 

/  = a way to seperate stuff and this can be use in string seperation like this 
:

Code:
module Cachedef self.something(filename)load_bitmap("Graphics/Something/",filename)endend
 

BoluBolu

Veteran
Veteran
Joined
Apr 24, 2014
Messages
452
Reaction score
117
Primarily Uses
@nio, I don't think that's the exact answer, the slash in your example used to move/look into a specific directory(folder in this case).

Three things that I know:

Usually forward slash is a divison operator used for math purpose, the other things that I know, forward slash is used for regexp too. And the last thing I know, it's like your answer, it used for separate between directory.

#OP

Hmm, It's not only in notepad++, I tried it to in sublime text and it does the same thing, athough it's not break the rest of code. I believe the "index"  in front of "/" is the culprit, but I don't know why, oh well I think I'll stick with this post, maybe there's someone can explain this =)
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
@nio, I don't think that's the exact answer, the slash in your example used to move/look into a specific directory(folder in this case).

Three things that I know:

Usually forward slash is a divison operator used for math purpose, the other things that I know, forward slash is used for regexp too. And the last thing I know, it's like your answer, it used for separate between directory.

#OP

Hmm, It's not only in notepad++, I tried it to in sublime text and it does the same thing, athough it's not break the rest of code. I believe the "index"  in front of "/" is the culprit, but I don't know why, oh well I think I'll stick with this post, maybe there's someone can explain this =)
oups made the error D:  sorry! well you mean the same thing of what I wanted truly to say XD
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
The coloring in program editors is always based on the language used - a really good editor let's you choose the coloring scheme depending on the filetype, and then the coloring is different depending on whether you write a program for pascal, C++, html or whatever.


However, if the editor hasn't been told what language is written (or if he simply don't have support for that language), then the coloring changes can be off in any way, simply because the editor applies format changes based on entirely different program structures.


That is NOT a bug, it simply means that your editor doesn't support (or doesn't recognize) the programming language of the current file.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Can you show a screenshot? I put that into Notepad++ and it does absolutely nothing.


Is your file saved? What's the extension? Notepad might format according to file extension. Then you may be able to set up other rules that affects its behaviour too.


Anyway, this is not really a scripting issue - more an editor issue, so I'm going to move this to Program and Utility Discussion
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top