so I have 4 divs I'm layering with z-indexs here, and am positioning with float and align left, two of them work and two of them don't. It's important for me to keep the position:relative, but I've been looking over the html to make sure there isn't any inconsistencies, and I just cant find anything, I'm looking for another pair of eyes to pick up what I'm missing here.
http://jsfiddle.net/xCkX7/14/
I have it posted here, it should ultimately look like a stack, all four sitting on top of another.
I'm try this
http://jsfiddle.net/p4Hzb/
relative positions not work for me.
Related
Im making a game in Rust(Im a beginner) for my son and am somehow struggling with platforms - specifically modifying their length. I can get the platforms if i use certain numbers but if i try to modify the platform width I run into problems.
If i use the const PLATFORM_WIDTH=400 then everything works fine (i seemingly can make any number of them and it all works), but I don't want to have platforms of a fixed width (length), I want each platform to be of variable width. If I try to make the platform width say 100.0 then it is rendered correctly but I can walk over empty space as if there was a platform there. If I make them greater than 400 they are rendered but the sprite will fall through solid floor at some points.
Really don't know where Im going wrong and this annoying issue is preventing me from making progress on my game.
Id really appreciate if someone could take a look at my code and tell me where im going wrong.
My code is here:
https://github.com/country-bumpkin-software/rusty-miner/blob/main/src/main.rs
Also can someone explain to me why the Rect function seems to take negative numbers for the x, y coords?
The problem is that you sometimes use the width from the platform struct (e.g. when checking for intersections on line 264) and sometimes use the PLATFORM_WIDTH and PLATFORM_WIDTH_HALF constants (e.g. when drawing the platform on line 346).
I have been looking at Epic Games' Fortnites Website and I am trying to figure out how they achieved the 3D effect on the page:
Epic Games' Fortnite website - scrolled down to 3rd slide
Does any one have any idea how to do it? I would really like something similar to a project I'm working on. I have found Three.js, but I am quite sure that is not the solution they went with.
For these types of questions, i can only recommend to install spector.js and have a look yourself. In short: everything you see is 100% faked.
I mean, that's always the case. In fact, if you want to build something like that, your first question should always be: how much of this can I fake and still get away with that?
In this example, it turns out: everything. Just open the devtools and click through all the assets in the network-tab. You will find these two textures:
looks familiar, right?
So what they appear to be doing is they are using three.js with some custom shaders to handle the translations, the flickering of the lights and the highlighting. These effects are computed using the normal-map and an additional mask-texture which I couldn't quite figure out what it does. But again, if you look at the scene in spector.js you can see the shaders used for every drawcall.
The only thing that is a bit more complex is the little robot-friend in the bottom left corner. But again, it's not 3d as in meshes and so on but rather a set of flat textured quads running a bones-animation thing.
I think that makes it a really great website after all.
Given that epic is building the unreal-engine I would suspect the original renders were done there. And I agree, the lighting looks really amazing :)
It is a simple parallax effect using animated sprite sheets.
Parallax effect is achieved by using several layers of images/video on top of one another in different Z-depth.
You can achieve the moving part by using the mousemove event to track the cursor.
This is really confusing the heck out of me. Take a look at this screenshot:
Sometimes, the GtkFrames in my program look like on the left side, and sometimes they look like on the right side - or even a mix of the two! The program is exactly the same. Just running the same program multiple times yields very different looks of the GtkFrames in the program! How can that be?
It seems that there are two different designs of GtkFrame:
The first one has its label centered at the top of the frame and
smoothly dissolves towards the
bottom so that the frame doesn't completely enclose the GtkFrame's
contents.
The second design has its label left-aligned at the top of the frame
and draws a border around the complete GtkFrame.
The problem is now that GTK+ seems to choose one of the two designs entirely at random. I don't see any pattern in which design I'm going to get. It appears to happen completely at random which is really confusing me.
Can somebody shed a light onto this mystery? What is going on here? Is there a way to force GTK+ to use a certain design?
I'm using GTK+ 2.24.10 with the Adwaita theme on Linux Mint.
Good day, I was wondering on how can I implement an effect like the ones on the sweepstakes where you scratch the grey part and reveal a number underneath it. I was wondering how can I implement that in unity, I don't have any clue where to start, thanks in advance.
the idea is, I have 2 overlapping objects, A and B, whereas when I click on a part of B it will be removed and will show a part of A, both A and B are sprite images though
This is not really related to Unity as such. This relates more to a general technical solution for a visual representation you would like to do.
So, let's skip the Unity part.
But even then the question is very general and hard to respond to. There are many ways to achieve this, depending on the result you want.
You could apply a quad object, with a grey texture on top of whatever number box you have and then either use shaders to show the number as you "scratch it". Or you could remove the grey square when clicking it (different behaviour). Or you could do the old school approach and replace pixels, as you "scratch" the box.
Only to mention a few ideas.
But still, the question is very general and hard to answer as it pertains to a general idea, and not so much a concrete question.
Look into how to build Fog of war shader. I would achieve this by rendering A and B with two separate cameras then as you scratch it off it would reveal B in the scratched area.
I saw an infographic online that I wanted to use as a challenge to learn d3.js. The original infographic is here:
http://www.shah3d.com/wp-content/uploads/2012/11/IG-WWF-Dehahs.png
I've made a start here:
http://www.tips-for-excel.com/d3test/arc/arc%20test.html
You'll notice that the original has nice lines that link an arc from the bottom with an arc along the top. So far I can only think of painfully placing lots of circles to achieve this effect, hence the odd red circle currently in my visual. What would people's best methods be to replicate the original graphic? Which element would make this task easier? Arcs? Lines? I imagine I'll have to manipulate my data so that the lines go where they're meant to.
Happy to give more info if needed and thanks for taking time to read this.
There are a few existing diagrams to work off of from d3's galleries:
http://bl.ocks.org/4062006
http://bost.ocks.org/mike/uberdata/
Both use the length of the chord as the width of the stroke (initially), but you can tinker with that, for sure.
Graphically, you could use arcs, or full circles with a clip around it. As to the 'best' way to do it, that may come out of 'requirements' of how your graphic needs to behave (animation, relative arc placement, etc).
Personally, I'd go with path arcs.