Request for code:

Discussion among members of the development team.

Moderator: Forum Moderators

Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Woodwizzle wrote:I think this would look 10x better if the text were justified. Is that possible?
What do you mean by justified? The text is currently left justified...

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Sounds good.
Dave wrote:
Woodwizzle wrote:I think this would look 10x better if the text were justified. Is that possible?
What do you mean by justified? The text is currently left justified...

David
"Justified" usually means that each line takes up the same space - the width of the spaces will be stretched or shrunken so that there is no blank space at the end of each line. ;)
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Sangel
Moderator Emeritus
Posts: 2232
Joined: March 26th, 2004, 10:58 pm
Location: New York, New York

Post by Sangel »

turin wrote: "Justified" usually means that each line takes up the same space - the width of the spaces will be stretched or shrunken so that there is no blank space at the end of each line. ;)
Actually, I'm fairly sure that "justified" means that all the first letters of each line of text line up neatly down the page - "left justified" means they line up neatly on the left side of the lines, "right justified" on the right, etc. Which would make Dave correct.

But let's not quibble about words. Would the text look better if each line were spaced to be of equal horizontal length? Would this feature be easy to code?
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Dunno. The only time I've ever seen it in the context of word processors, where it is in contrast to left, center, and right.

According to Webster's, it means:
5. (Print.) To make even or true, as lines of type, by proper
spacing; to align (text) at the left (left justify) or
right (right justify) margins of a column or page, or at
both margins; to adjust, as type. See {Justification}, 4.
[1913 Webster]
Which seems to justify both of our definitions. (Yay, bad puns).
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

Excellent! Thanks, Dave! :D

Now we move to Phase Two:
Just what are we going to do with those X-Y appointed Dots/Crosses?

My thought is that they should just have a normalized value indicating how far they are across the screen, as a fraction of the screen's width. Values, thus, would be valid from 0 <-> 1.0.

I'm going to commit the new map into there (after I test it).
My thought is that folks like Scott should NOT mess with the XY values until the new system is in. The good news is that a simple math function should be able to transform the xy values from their previous setting into the new one.

newX = oldX / 640
newY = oldY / 480
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

:? I've checked on this, and though the old system still works, the positions are all off, since they're still relative to the previous origin.

I think they should be normalized to 0 <-> 1, since this is much more intuitive, and I'm going to try and write a patch to change them to that (as well as doing all the necessary changes by hand).

This is mostly just to practice some C++.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Dot coordinates should be scaled like the image. So if the image is 800x600 and I have a dot at 400,300 and the image gets scaled to 640x480, the dot would appear at 320,240. This is how the story screen maker can have some hope of being able to plot the dots accurately. A simple 0 <-> 1 range would be considerably more clumsy to use.
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

zookeeper wrote:Dot coordinates should be scaled like the image. So if the image is 800x600 and I have a dot at 400,300 and the image gets scaled to 640x480, the dot would appear at 320,240. This is how the story screen maker can have some hope of being able to plot the dots accurately. A simple 0 <-> 1 range would be considerably more clumsy to use.
The key thing is the method by which people determine what coordinates are. Based on what you've just said - the easiest method would be to open a graphics program that allows one to position the cursor and read coordinates.

I talked with Dave, and he's coded the system to work that way right now.

So ... I don't have to make a patch to do that. Not to mention that, as you said, that is the easiest way to read coordinates (easier than normalizing, though normalization would only entail a division operation). Since we won't be rearranging maps in size very often, which is the thing normalization would be good for, I suppose we can scratch that.

However, I should still make a patch to bump the text down by a line.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

With a new map, the relative locations are different so the dots all need to be redone. Off by a little = off by a lot, I'm afraid, but I could be wrong.

Relative coordinates from 0-1 would be great. I would really go for that, except it occurs to me that I (or someone) could be finding the dot locations now and multiplying the result by the image size to input the answer in pixels if necessary.

Then again, any image viewer that reports the cursor location in pixels would be all you need to figure out center locations. The trial-and-error method I used was not too bright in retrospect.

I request that the title text at the top be placed on top of a dark rectangle or else some space is left for title text. It can be hard to see on top of a light image.

My second request is that everyone updates the wiki with whatever coding changes are made. http://www.wesnoth.org/wiki/ScenarioWML
Hope springs eternal.
Wesnoth acronym guide.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

here be: ink-like dashed line graphics
if somebody wants to do that part...
Attachments
dashed-lines.zip
(3.99 KiB) Downloaded 522 times
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
Post Reply