Welcome Guest, Not a member yet? Register   Sign In
Codeigniter functions in custom css file
#1

[eluser]Haskabab[/eluser]
Hi what's up,

I'm developing a world_map library for my codeigniter based game, and I'm currently doing the render_map() function.

I basically have 1 huge map image (3500x3500) and I only want to zoom in on a particular area (where the player is walking).

I finished the function using GD, but it takes a lot of time to render that image so I was forced to switch to using CSS.

So what i want is a div with the particular area of the map as background image, which i achieved by adding the following css to my main css file:

Code:
#world-map {
    width: 500px;
    height: 500px;
    background-color: #000;
        background-image: url(../img/world/world_map.jpg);
        background-position: 250 250;
        border: 1px solid #000;
}

Now what i want is that all these values become variables! So i can dynamically render out the final css and the world map.

The solution i found was using a .php file as an css like so:

/assets/css/world_map.php
Code:
<?php header("Content-Type: text/css;"); ?>
    
#world-map {
    width: 700px;
    height: 500px;
    background-color: #000;
           background-image: url(../img/world/world_map.jpg);
           background-position: 250 250;
           border: 1px solid #000;
}

But now i want to pass my variables through my controller, but i don't know how to transfer this data to the actual world_map.php (css) file..

I can't seem to access any codeigniter functions within the world_map.php (css) file, so the session->flashdata functions can't be used..

So my question is: how do i pass my variables from my library to my external world_map.php css file?

Thanks in advance


Messages In This Thread
Codeigniter functions in custom css file - by El Forum - 10-08-2010, 05:07 AM
Codeigniter functions in custom css file - by El Forum - 10-09-2010, 12:49 AM
Codeigniter functions in custom css file - by El Forum - 10-09-2010, 05:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB