Search found 50 matches

by Rick
15 May 2015, 16:33
Forum: General Discussion
Replies: 5
Views: 2154

Re: Image size when changing parents

Do you happen know the C# equivalent to that? I practice things in C#/VS and it looks like TransformToDescendant() in C# returns a GeneralTransform. I'm not a big math guy but I do seem to recall Matrix holding position, rotation, scale right? So I assume what you are doing is taking the scale part ...
by Rick
11 May 2015, 18:06
Forum: General Discussion
Replies: 5
Views: 2154

Re: Image size when changing parents

So when I try the ActualWidth/Height in C# with VS it works when the window starts and isn't maximized. When I max the window and everything scales correctly (even the rect's that are inside the inventory grid) the icon size is still the original starting size. Should ActualWidth adjust when the win...
by Rick
01 May 2015, 19:44
Forum: General Discussion
Replies: 5
Views: 2154

Image size when changing parents

I have a border control as a parent to the grid and when I set the rowspan and colspan it sizes correctly. Then I change it's parent to a canvas and now the size is very very very small. I can barely see it, but it's there. How can I keep the width/height to be the same size as it was when the grid ...
by Rick
01 May 2015, 19:29
Forum: General Discussion
Replies: 1
Views: 930

setting new parent

My border has a grid as it's parent. However, when I selected the item I want to change it's parent to a canvas but when I try to add the border to the canvas I get an error saying it already has a parent. How can I change parents? I assume I need to do this in order to have my border draw on the ca...
by Rick
01 May 2015, 01:58
Forum: General Discussion
Replies: 4
Views: 1539

Re: Setting parent

So that worked to make the icon look like it's inside the grid area. I am curious though as to when I do the dragging idea how to move the border around with the mouse. I noticed in your inventory example you were using a canvas. Is that required? I don't have a canvas holding all of this. I just ha...
by Rick
30 Apr 2015, 22:29
Forum: General Discussion
Replies: 3
Views: 1760

Re: Blend paths vs build tool

I have ImageBrush's: <Grid x:Name="MasterGrid" Margin="0,0,0,5"> <Grid.Resources> <ImageBrush x:Key="rifle" ImageSource="items.png" Stretch="Fill" ViewboxUnits="Absolute" Viewbox="0,0,256,64"/> <ImageBrush x:Key="water_bottle" ImageSource="items.png" Stretch="Fill" ViewboxUnits="Absolute" Viewbox="0...
by Rick
30 Apr 2015, 21:44
Forum: General Discussion
Replies: 3
Views: 1760

Blend paths vs build tool

In Blend I made a folder called Images. I place all my images in there and all my xaml reference Images/myimage.png. When I run this through the Build Tool I get an error on the xaml saying: Parsing Image.Source Image 'Images/Images/myimage.png' not found. Why is the BuildTool attaching another Imag...
by Rick
30 Apr 2015, 21:09
Forum: General Discussion
Replies: 4
Views: 1539

Setting parent

I have a function where I create a border control and I give it a background based on a resource name. After this function is done I don't see anything and I'm guessing it's because it has no parent. How can I set the parent and is there anything else I'm missing here? I get that I have a memory lea...
by Rick
23 Apr 2015, 20:16
Forum: General Discussion
Replies: 9
Views: 2450

Re: Element sizing with different resolutions [Updated w/pic

OK, so I added a Viewport then grid to that and filled the "slots" with rect's at 25% transparency and it scales and works great! The main difference between your drag and drop example and my game is that my game is more diablo style where items can take up more than 1 slot. In reality these rect sl...
by Rick
22 Apr 2015, 17:23
Forum: General Discussion
Replies: 9
Views: 2450

Re: Element sizing with different resolutions [Updated w/pic

OK, I'll give this a try. I've just been using Grids inside Grids and it seems to give a similar result but maybe if I need the internal grid to scale uniformly with the image the Viewbox is needed. Any tips on how these inventory slots should be handled? Should they be shapes so they get click & dr...