It is currently May 6th, 2024, 6:30 am

Screen grid for item positioning

Get help with creating, editing & fixing problems with skins
User avatar
Ivan
Posts: 258
Joined: January 27th, 2012, 6:37 pm
Location: Belgrade, Serbia

Re: Screen grid for item positioning

Post by Ivan »

I am on laptop, and in my case centimeters on screen are smaller than in reality. My screen is W=38.5 cm and it show 43 cm in skin.
And invisibility switch is not working.
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Screen grid for item positioning

Post by balala »

Ivan wrote:I am on laptop, and in my case centimeters on screen are smaller than in reality. My screen is W=38.5 cm and it show 43 cm in skin.
And invisibility switch is not working.
The centimeter can be smaller than in reality, because on the skin you have two numeric values that must be determined, it seems that for any screen individualy. In the meantime I tried it onto another screen and got other values for both. I modified a bit the code, so: now you have these two variables: SettingForCm and SettingForInch. With the skin loaded, set it to cm, then on the screen with a real ruler, play a bit with the SettingForCm variable to take the distances on the screen closer as possible to the real distances. Repeat it with the inche setting, too. You have to try a value, refresh the skin and so on, until you find the best value. I know it's a patience game, but if you want to use the skin, you have to do that.
I added the invisibility switch, too. Now it's working.
Sorry for the inconveniences.
You do not have the required permissions to view the files attached to this post.
User avatar
Ivan
Posts: 258
Joined: January 27th, 2012, 6:37 pm
Location: Belgrade, Serbia

Re: Screen grid for item positioning

Post by Ivan »

Trust me I know how hard is to find correct math formula sometimes :)

And no need to apologize, only way not to make mistake from time to time is to do nothing at all.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Screen grid for item positioning

Post by eclectic-tech »

balala wrote: The centimeter can be smaller than in reality, because on the skin you have two numeric values that must be determined, it seems that for any screen individualy. In the meantime I tried it onto another screen and got other values for both. I modified a bit the code, so: now you have these two variables: SettingForCm and SettingForInch. With the skin loaded, set it to cm, then on the screen with a real ruler, play a bit with the SettingForCm variable to take the distances on the screen closer as possible to the real distances. Repeat it with the inche setting, too. You have to try a value, refresh the skin and so on, until you find the best value. I know it's a patience game, but if you want to use the skin, you have to do that.
I added the invisibility switch, too. Now it's working.
Sorry for the inconveniences.
Thanks balala... I will look at this (beta7) and set what you came up with.

I made a few changes to my previous code, mostly thinking about eliminating the input boxes all together, and just scale the grid with the mouse wheel.

I will let you know more after looking at your additions... :)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Screen grid for item positioning

Post by eclectic-tech »

Balala, you 'Rule'! ;-)

I combined what you have with a different control for the grid.
I increased the number of line meters. 120 vertical/80 horizontal to hopefully have the grid cover nearly all resolutions. I used your ruler dimensions: 3000x2000. The meters are now in an included file @Resources\Includes\GridLines.inc
The grid spacing will now change with mousewheel actions (no user input needed) from 20-50 pixels in 5 pixel steps. Beyond that, I have had issues; have you?
Do you have the capability to try this on other screen resolutions?

Current Controls:
* Slowly Scroll up/down on either ruler to increased/decrease the vertical/horizontal grid spacing.
* Scroll up/down on the 'unit' label to step from pixels/inches/centimeters rulers.
* Hold left mouse button down on either ruler to activate transparency; release to restore. Click ruler and move mouse away BEFORE releasing the button to keep current tranparency.
* Line spacing (in pixels) is shown in the upper left corner.

Let me know if you think we need to change/revert anything.

beta 7a (This will overwrite the old version; it will be in @Backup, but I copied it also.)
You do not have the required permissions to view the files attached to this post.
User avatar
Ivan
Posts: 258
Joined: January 27th, 2012, 6:37 pm
Location: Belgrade, Serbia

Re: Screen grid for item positioning

Post by Ivan »

I think that you would need two static lines all the time, one on vertical 50% of screen and one on horizontal 50% of screen, you can make them different color too.
Or to make switch that can change either distance in pixels between lines or number of equally distanced lines.
This is because for my actual theme, I like to know where center is and to be able to put skins in relation to canter of the screen. But for my previous skin this mouse scroll set up to 25x40 px distance is perfect for alignment.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Screen grid for item positioning

Post by eclectic-tech »

Ivan wrote:I think that you would need two static lines all the time, one on vertical 50% of screen and one on horizontal 50% of screen, you can make them different color too.
Or to make switch that can change either distance in pixels between lines or number of equally distanced lines.
This is because for my actual theme, I like to know where center is and to be able to put skins in relation to canter of the screen. But for my previous skin this mouse scroll set up to 25x40 px distance is perfect for alignment.
Thanks Ivan!
I think the center lines coloration is a great idea, I will implement that. :thumbup:

The way the grids are now drawn, the center lines may not always align with the rest of the grid...
I will look at spacing from the center outward, but that may not happen too soon. :(

And yes, I have the pixel lines set, and now have to incorporate balala's conversion into the positioning for inches and centimeters, perhaps in different included grid files. :???:

Back to tinkering with the code!
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Screen grid for item positioning

Post by balala »

eclectic-tech wrote:Let me know if you think we need to change/revert anything.

beta 7a (This will overwrite the old version; it will be in @Backup, but I copied it also.)
Today I was busy a bit, so until now I had no time to work with our little project, but now I'm here. So:
- your idea with scrolling the ruler, is brilliant, much better the those user input fileds. Keep it!
- I find the unit scrolling less good. I modified a bit to can change the unit with clicks. One question I have here is that I already tried to implement this yesterday, not this way, but using the !SetVariable bang and it didn't work! Have you any idea, why? I couldn't find it, so finaly gave it up.
- the central lines would be good. Maybe I'll give it a try, to see what can I do. I don't want to stole your idea, if you do it, we'll implement your solution.
- I moved the meters of both rulers into an inc file, as you done with the meters of the grids.
- I think there's no need of the Include folder into the resource folder, so I erased it, putting the two inc files directly into the resource folder. I hope you'll find this a good idea (less folders seems to me a good practice).
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Screen grid for item positioning

Post by eclectic-tech »

Alignment Grid ~ Beta 0.8 :cheers:

Added Center Lines (Green, but can be changed)

Added Grid Line Includes files for CM & IN dimensions

Lines now expand/decrease from the center

Added Grid Spacing meter for CM & IN dimension
Size is very close on my monitor (less accurate at edges). Some of the '100 pixel' conversion calculation variables, may need tweaking ;-)

I think we are closer to our vision for this, what do you think it needs or lacks? :???:
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Screen grid for item positioning

Post by balala »

It seems that we have posted our newest skins on the same time. I downloaded yours and I have to say it's very good!
I'll move once again the meters of the two rulers into another inc file, but I'd still eliminate the Include folder.
The central lines are great!
Maybe I'd say that we have to eliminate the cm and inches gradation of the rulers and keep just those in pixels. There are a lot of troubles with them! What you say?
Congratulations for this work, this project indeed became an interesting work (at least for me).