It is currently October 22nd, 2024, 11:40 pm

Determining the top / bottom position

Get help with creating, editing & fixing problems with skins
User avatar
Rooky_89
Posts: 81
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Determining the top / bottom position

Post by Rooky_89 »

Yincognito wrote: October 19th, 2024, 5:34 pm I don't see you setting back the anchor to "0" "0%" in the code, I suppose you only use the skin at the bottom of the screen and expanding upwards now and you don't really need the anchor back at the top left corner of the skin
I actually wanted to do it like this with the previous idea :great: . The skin knows where is it based on an calculation, where she is placed and attaches itself to the edge of the screen like a magnet [Top or Bottom]. This worked well so far. Unfortunately, the problem with the expansion then arose because the anchor had to change. That then no longer worked with the calculation :oops: :lol: . So there was i confused to find a solution. :?

Maybe there is a new try :rolmfao: :rofl:
User avatar
Rooky_89
Posts: 81
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Determining the top / bottom position

Post by Rooky_89 »

balala wrote: October 19th, 2024, 6:07 pm
!SetWindowPosition bang can alter both: the position and the anchor of the skin, by one.
Thanks, Balala. :welcome: :rosegift: :great:

For your tip. Sometimes you overlook clues or information because you're so busy with your project. And most of the time you only understand things at second glance. :oops: :lol:
User avatar
Yincognito
Rainmeter Sage
Posts: 8537
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Determining the top / bottom position

Post by Yincognito »

balala wrote: October 19th, 2024, 6:07 pm Instead of the !Move bang, the !SetWindowPosition bang can alter both: the position and the anchor of the skin, by one.
Indeed. In this approach I was discarding changing the anchor completely, hence mentioning (only) !Move. But yeah, it can definitely be done via !SetWindowPosition - I like it too, since you can change more things with it. I almost never use !SetAnchor as a result, since !SetWindowPosition has that and more. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16686
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Determining the top / bottom position

Post by balala »

Rooky_89 wrote: October 19th, 2024, 6:20 pm Thanks, Balala. :welcome: :rosegift: :great:

For your tip. Sometimes you overlook clues or information because you're so busy with your project. And most of the time you only understand things at second glance. :oops: :lol:
:thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 8537
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Determining the top / bottom position

Post by Yincognito »

Rooky_89 wrote: October 19th, 2024, 6:10 pm I actually wanted to do it like this with the previous idea :great: . The skin knows where is it based on an calculation, where she is placed and attaches itself to the edge of the screen like a magnet [Top or Bottom]. This worked well so far. Unfortunately, the problem with the expansion then arose because the anchor had to change. That then no longer worked with the calculation :oops: :lol: . So there was i confused to find a solution. :?

Maybe there is a new try :rolmfao: :rofl:
Simple variant without changing the anchor, just to illustrate how I imagined that approach:

Code: Select all

[Variables]
SW=320
SH=90
SE=0
SD=0
ImageFolder=D:\Images\Wallpapers\- Single -
Interval=5

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

---Measures---

[ImageName]
Measure=Plugin
Plugin=QuotePlugin
PathName=#ImageFolder#
FileFilter=*.png;*.jpg;*.jpeg;*.bmp
UpdateDivider=#Interval#

---Meters---

[Container]
Meter=Shape
Shape=Rectangle 0,0,([#SW]),([#SH]+[#SE]),10 | Fill Color 0,0,0,255 | Stroke Color 0,0,0,0 | StrokeWidth 0
DynamicVariables=1

[Image]
Container=Container
Meter=Image
W=([#SW])
H=([#SH]+[#SE])
PreserveAspectRatio=0
MeasureName=ImageName
MouseOverAction=[!SetVariable SE 90][!SetVariable SD ([#CURRENTCONFIGY]+[#SH]+[#SE]>[#SCREENAREAHEIGHT]?-1:0)][!UpdateMeter *][!Redraw][!Move ([#CURRENTCONFIGX]) ([#CURRENTCONFIGY]+[#SD]*[#SE])]
MouseLeaveAction=[!SetVariable SE 0][!UpdateMeter *][!Redraw][!Move ([#CURRENTCONFIGX]) ([#CURRENTCONFIGY]-([#SD]*#SE#))]
DynamicVariables=1
This will by default expand downwards aka towards the bottom of the screen, except when the skin itself is near the bottom of the screen and there's no room to expand it downwards (in which case it will expand upwards aka towards the top of the screen).

P.S. As alluded before by balala and me, you can't really change the skin position to a (partially or completely) off-screen one by mouse dragging, if you have Keep On Screen enabled for the skin, so you have to do it either by changing the Coordinates for the skin in the Manage Rainmeter window, or by disabling Keep On Screen for the skin and dragging it freely.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth