It is currently April 25th, 2024, 10:20 am

using a mask with a dynamically moving image "under" the mask

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

Hi, I am trying to create an image meter that is partially hidden by a mask that does not move.

The image is meant to move right as a dynamically fetched string of almost any length controls the visible portion of the image's position. The mask would need to remain static so it would appear that the image is growing wider to accommodate the string's dynamic length.

Another problem I have is I dont know how to create such a mask. I know it is based on having an alpha channel. But how that actually works has got me stumped as well.
Mesh11.png
The mask would be positioned initially so that another image would reside "over" the mask as a visible image that makes the left appear to be generally round in shape to start with.

Thanks for any help.
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: using a mask with a dynamically moving image "under" the mask

Post by balala »

Post please what you have so far (the mask, the image, the code of the skin with the measure(s) which return(s) the string and so on).
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

I have since realised that I do not need a mask.
Instead, I have been working on using ImageCrop.
This is the baseline for my image.

Code: Select all

[Mesh11Mask]
Meter=Image
ImageName=#@#Mesh11.png
ImageCrop=84,0,123,156,1
X=1688
Y=556
W=123
H=156
For my idea to work, I will need to figure out the formulas for the 2 X parameters to dynamically change according to the Text length of a string meter.

The formulas however are beyond my math ability at this stage.
This is how I imagine what it might look like:

Code: Select all

[Mesh11Mask]
Meter=Image
ImageName=#@#Mesh11.png
ImageCrop=[CalcFormulaA],0,123,156,1
X=[CalcFormulaB]
Y=556
W=123
H=156
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

So, both X values would increase as both more of the image was revealed, and how far to the right the X coordinate of the image has to move to accommodate the increased reveal of the image.

Does that make sense?

The W & H of the image meter is the size of the complete image.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: using a mask with a dynamically moving image "under" the mask

Post by balala »

Mor3bane wrote:Does that make sense?
It make, but I just would add that two thing will go on with the posted ImageCrop option:
  • The ImageCrop option is pushing the visible part of the image to right and left of the image (according to the value returned by the [CalcFormulaA] measure).
  • Secondly the image meter itself will be moved (due to the X=[CalcFormulaB] option).
And one more: due to the above two options, the [Mesh11Mask] meter requires a DynamicVariables=1 option. Don't forget to add it.
Mor3bane wrote:The W & H of the image meter is the size of the complete image.
No, that's not. W and H is the size of the image meter. And these two are not the same at all. When the image meter is cropped, the visible part of the image will get the size set up by the W and H options of the Image meter (won't be resized accordingly to the proportion of the cropped part of the image).
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

balala wrote:It make, but I just would add that two thing will go on with the posted ImageCrop option:
  • The ImageCrop option is pushing the visible part of the image to right and left of the image (according to the value returned by the [CalcFormulaA] measure).
  • Secondly the image meter itself will be moved (due to the X=[CalcFormulaB] option).
And one more: due to the above two options, the [Mesh11Mask] meter requires a DynamicVariables=1 option. Don't forget to add it.

No, that's not. W and H is the size of the image meter. And these two are not the same at all. When the image meter is cropped, the visible part of the image will get the size set up by the W and H options of the Image meter (won't be resized accordingly to the proportion of the cropped part of the image).
Yes, I realised the DynamicVariables=1 was needed.

However, I am getting nowhere with a viable formula.

Did you mean to say that this idea will now work at all, or that the formula would be really crazy?

Or, what was your meaning, please?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

This is what I am starting with, but nothing is happening.

I am testing the string meter with a long Text string and sippo is happening and the image is not moving.

Code: Select all

[Mesh11CalcCropX]
Measure=Calc
Formula=(84+[Mesh11CompName:W])

[Mesh11CalcX]
Measure=Calc
Formula=(1688+[Mesh11CompName:W])

[Mesh11Mask]
Meter=Image
ImageName=#@#Mesh11.png
ImageCrop=[Mesh11CalcCropX],0,123,156,1
X=[Mesh11CalcX]
Y=556
W=123
H=156
DynamicVariables=1
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

Ok this *should* work. But nothing happens.

Am I using [Mesh11CompName:W] in a place where it wont register as a number value?

Code: Select all

[Mesh11CalcCropX]
Measure=Calc
Formula=84-[Mesh11CompName:W]

[Mesh11CalcRevealX]
Measure=Calc
Formula=123+[Mesh11CompName:W]

[Mesh11CalcX]
Measure=Calc
Formula=1688+[Mesh11CompName:W]

[Mesh11Mask]
Meter=Image
ImageName=#@#Mesh11.png
ImageCrop=[Mesh11CalcCropX],0,[Mesh11CalcRevealX],156,1
X=[Mesh11CalcX]
Y=556
W=[Mesh11CalcRevealX]
H=156
DynamicVariables=1
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: using a mask with a dynamically moving image "under" the mask

Post by Mor3bane »

Ok DynamicVariables again....
This got results, but I am a but vague on how to assign a clamp, or where it would go in the formulas.
Any additional help is appreciated.

Code: Select all

[Mesh11CalcCropX]
Measure=Calc
Formula=84-[Mesh11CompName:W]
DynamicVariables=1

[Mesh11CalcRevealX]
Measure=Calc
Formula=123+[Mesh11CompName:W]
DynamicVariables=1

[Mesh11CalcX]
Measure=Calc
Formula=1688+[Mesh11CompName:W]
DynamicVariables=1

[Mesh11Mask]
Meter=Image
ImageName=#@#Mesh11.png
ImageCrop=[Mesh11CalcCropX],0,[Mesh11CalcRevealX],156,1
X=[Mesh11CalcX]
Y=556
W=[Mesh11CalcRevealX]
H=156
DynamicVariables=1
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: using a mask with a dynamically moving image "under" the mask

Post by balala »

Still don't know a lot of thing related to your code. For example the [Mesh11CompName] is completely unknown (for us). Also what this meter shows up, how it gets the string which should have to show up. So again please: https://forum.rainmeter.net/viewtopic.php?p=149149#p149149